[cups.development] cups bypassing interface

Michael Sweet msweet at apple.com
Tue Sep 4 15:17:38 PDT 2012


William,

Add "-o document-format=text/plain" when printing to avoid auto-typing as a "raw" file format.


On Sep 4, 2012, at 5:33 PM, William Michael Luyties <william_luyties at reyrey.com> wrote:

> I have several serial printers that are set up basically as raw queues on my system.  On these, I have installed interface scripts to perform some simple output manipulation and to handle IPC with an application that likes to attach directly to printers and write to them.  Everything there was working.
> 
> However, there is another application on the machine that, while it does go through cups, appears to be injecting printer-specific codes into its spool files.  In other words, the files being sent to the printers through cups are not simply plain text, but start out with some escape codes.  When such files are spooled to cups, cups appears to bypass the interfaces that I have installed on my serial printers and just print the file.
> 
> I was able to test this by setting up two print files.  One contains the plain text "Hello, world!" followed by a newline character while the other contains a few printer escape codes followed by the "Hello, world!" and newline.  I then added a "sleep 5" to my interface for a noticeable delay when printing.  When I print the first file, nothing happens for five seconds after which the text is printed out; when I print the second file, the text is printed out immediately to the printer.
> 
> When I was testing my initial implementation of the interface, I had been using the "-o raw" option to the lp.cups command and noticed that it was bypassing the interface.  It took me a while to figure out that I needed to leave this option off in order to get it to go through the interface.  My guess is that cups sees the escape codes and automatically kicks into this "raw" mode to bypass my interfaces.  I had assumed that since these were "raw" queues, all print was being treated as "raw", but still sent through the custom interface.
> 
> Is there any way to send an option to cups to tell him not to try to detect the type and just send whatever he receives to the interface?  Is there any way to specify that the printer data is in a particular format and perhaps trick cups into sending it to the interface (e.g., telling him it is plain text even though it contains escape codes)?
> _______________________________________________
> cups-dev mailing list
> cups-dev at easysw.com
> http://lists.easysw.com/mailman/listinfo/cups-dev

__________________________________________________
Michael Sweet, Senior Printing System Engineer, PWG Chair





More information about the cups-devel mailing list