Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

It seems when you pass a file to lpr (or pipe to it), it attempts to guess the MIME type. Sometimes, however, it guesses wrong—and then attempts to print something "interesting" at best.

Is there a way to manually override the MIME type?

share|improve this question

1 Answer 1

The MIME type is sent in the IPP attribute document-format, which you can specify with the -o option:

lpr -o document-format=text/plain ...

Note that if you try a document format that your CUPS server doesn't support, you'll get an error:

$ lpr -o document-format=image/svg+xml drawing.svg 
lpr: Unsupported document-format "image/svg+xml".

That error is actually coming back from the server.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.