[cups] Cut paper

Helge Blischke helgeblischke at web.de
Wed Dec 16 06:48:16 PST 2015


> Well, I’ll install a fake zebra printer to be able to look into the output
> of gstoraster as well as rastertolabel and trace down where the
> CutMedia stuff disappears.
> 
> Helge

Well, I’ve done that, using your PPD.

Here is an excerpt of the cups error_log when printing a test page:

….
I [16/Dec/2015:15:18:05 +0100] [Job 297] Started filter /usr/libexec/cups/filter/cgbannertopdf (PID 7128)
I [16/Dec/2015:15:18:05 +0100] [Job 297] Started filter /usr/libexec/cups/filter/gstoraster (PID 7129)
I [16/Dec/2015:15:18:05 +0100] [Job 297] Started filter /usr/libexec/cups/filter/rastertolabel (PID 7130)
I [16/Dec/2015:15:18:05 +0100] [Job 297] Started backend /usr/libexec/cups/backend/socket (PID 7131)

….

D [16/Dec/2015:15:18:06 +0100] [Job 297] StartPage...
D [16/Dec/2015:15:18:06 +0100] [Job 297] MediaClass = ""
D [16/Dec/2015:15:18:06 +0100] [Job 297] MediaColor = ""
D [16/Dec/2015:15:18:06 +0100] [Job 297] MediaType = ""
D [16/Dec/2015:15:18:06 +0100] [Job 297] OutputType = ""
D [16/Dec/2015:15:18:06 +0100] [Job 297] AdvanceDistance = 0
D [16/Dec/2015:15:18:06 +0100] [Job 297] AdvanceMedia = 0
D [16/Dec/2015:15:18:06 +0100] [Job 297] Collate = 0
D [16/Dec/2015:15:18:06 +0100] [Job 297] CutMedia = 4
D [16/Dec/2015:15:18:06 +0100] [Job 297] Duplex = 0
D [16/Dec/2015:15:18:06 +0100] [Job 297] HWResolution = [ 203 203 ]
D [16/Dec/2015:15:18:06 +0100] [Job 297] ImagingBoundingBox = [ 0 0 288 360 ]
D [16/Dec/2015:15:18:06 +0100] [Job 297] InsertSheet = 0
D [16/Dec/2015:15:18:06 +0100] [Job 297] Jog = 0

…

You see, the raster data header has the "CutMedia = 4“ set.

The EPL2 data stream looks like (beginning and end):

N
D10
q816
GW0,0,102,1
…data…
…
…
GW0,1014,102,1
…data…
P1

You see, the data stream begins with the commands to reset the printer,
set the density and the label width, followed by a series of graphic data lines,
and ends with the command to print one label.

There is no cutting related command whatsoever – there should be the C command
at the end to cut immediately.

So, I think there is a bug in the rastertolabel filter. 
I looked into the source of this filter (cups version 2.1.0) and found that cutting is only
implemented for ZPL printers.

So I’d suggest you file a bug at cups.org <http://cups.org/> and see what Michael Sweet replies.

In the meantime you could perhaps hack (or let hack) a wrapper script around
the rastertolabel filter that looks for the CutMedia setting in the input and appends
the cut command to the output, and it certainly would be your turn to do the testing
with the real printer.

Helge




More information about the cups mailing list