I have my default printer set: lpoptions -d HP_ENVY_5530_series.I can print some text:echo HELLO > h.txtlp h.txtCUPS understands many different types of files directly, including text, PostScript, PDF, and image files.I can print a Portable Network Graphics: lp Gnome2.26-printing-dialogue.png.A Scalable Vector Graphics: lp Cups_simple.svg - prints as its internal text contents, which isn't much use.A scanned JPEG: lp 022.jpg - gets stopped Unable to open image file for printing!. If I convert it to a PNG with ImageMagick - convert 022.jpg 022.png, I can then print it lp 022.png.I would like an explanation for these limitations of the CUPS lp command.
limitations of CUPS command line printing of image files
arch linux;cups;lp;svg;png
CUPS has a filter mechanism to detect the format of its input and convert it to a built-in format (PostScript or to a raster image).CUPS has a database of file names and magic numbers (distinct from the one used by the file command, but serving a similar purpose and operating on similar principles). It uses this database to construct a transformation chain between the input and a built-in format.The database is located in /usr/share/cups/mime/ on Arch Linux and Ubuntu; other distributions may use a different path.If CUPS doesn't recognize the input format, depending on how the filters are set up, it may either assume text or refuse printing. Look for a line containing just application/octet-stream (with nothing else afterwards) in your filters; if it's present, then unrecognized input is passed to the printer, otherwise it'll be rejected as unprintable.Note that input that looks like text, for example SVG, will be printed as text in any sane configuration. If your installation has nothing that defines the SVG format, then SVG will be recognized under some generic text rule and printed as is.There's some good documentation about writing filters on the SuSE wiki.You should install at least the cups-filters package (formerly by Apple and included in CUPS itself, now maintained by OpenPrinting). There's a package in Arch. This includes a filter for JPEG, but not for SVG.