OpenPrinting/cups-filters

Passthrough label printer MIME types

andreaskem opened this issue · 0 comments

Is your feature request related to a problem? Please describe.
(See also michaelrsweet/lprint#103 for a longer explanation)

What I have: Files containing EPL2/ZPL (Eltron/Zebra Programming Language) statements that describe labels for Zebra label printers. These files are created by an existing system.
I would like to print these files on label printers that know how to handle EPL2/ZPL and I would prefer the solution to work with printer applications (i.e., lprint) in the future.

Describe the solution you'd like
I would like to be able to do the equivalent of lp -d labelprinter label.epl (whether on the command line or via the CUPS library) and get a proper label. lprint handles EPL/ZPL properly with special MIME types, lprint -d labelprinter label.epl works, and document-format-supported 1setOf mimeMediaType contains application/vnd.eltron-epl or application/vnd.zebra-zpl for the Get-Printer-Attributes request.

Ideally, I would not have to worry about the type of printer or the type of file because CUPS should be able to figure out the file type, notice that lprint can handle it natively and pass through the original file unmodified. However, there is no pass-through filter for these files, they are always incorrectly converted to some other format and the result is a label containing the plain text EPL/ZPL statements.

lprint speaks IPP, so I assumed I could just do the following:

sudo lprint add -d labelprinter -v socket://labelprinter -m epl2_2inch-203dpi-dt -o label-mode-configured=peel-off
sudo lpadmin -m everywhere -p labelprinter -v ipps://localhost:8000/ipp/print/labelprinter
lp -d labelprinter label.epl

Apparently, CUPS filters are not able to handle printer-specific formats and there is no pass-through filter. Moreover, lp -o document-format='application/vnd.eltron-epl' is rejected by CUPS

lp: Unsupported document-format "application/vnd.eltron-epl".

Describe alternatives you've considered
An alternative is to talk to the printer application directly via its own specific interfaces. However, I would have to talk to different components using different APIs/CLI programs depending on the file and/or printer type. Sending IPP requests directly would also be an option but not all printer applications and devices support all requests. I would like to avoid doing things that I consider to be CUPS' job.
These options are not great and a Common UNIX Printing System should ideally be able to figure out what to do. To be sure, label printers are somewhat special devices, but almost everything seems to be in place for this to work. There is still an impedance mismatch somewhere, though.

Additional context
michaelrsweet/lprint#103