Artificial intelligent assistant

Specify MIME type to CUPS's lpr command 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?

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.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 1d918be54556dbbb312bc0862660efa1