Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 4 down vote accepted

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


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.