[cups] Print range confusion

Mathias Weyland mathias at weyland.ch
Tue Jun 5 10:56:00 PDT 2018


Hello

I ran into the following issue with a manjaro linux client (2.2.7-2) 
and a raspbian-based cups server (2.2.1-8): Printing from the client 
generally works. Printing from the server (i.e. "locally") always works. 
However, when I print from the client imposing a page range constraint, 
nothing is printed. Example:

lp -d HP_LaserJet_1018_pi_printserver -P15 file.pdf

The server error log reveals:

-->--
D [05/Jun/2018:13:15:06 +0000] [Job 14] Started filter pdftops (PID 
2669)
D [05/Jun/2018:13:15:06 +0000] [Job 14] Started filter pstops (PID 
2670)
D [05/Jun/2018:13:15:06 +0000] [Job 14] Syntax Error: Invalid page 
count 0
D [05/Jun/2018:13:15:06 +0000] [Job 14] Command Line Error: Wrong page 
range given: the first page (1) can not be after the last page (0).
D [05/Jun/2018:13:15:06 +0000] [Job 14] The print file is empty.
--<--

Careful investigation of the cups pipeline with the help of fledermaus 
in the cups IRC channel reveals:

1. The server spools a pdf file that is already a single page (i.e. 
page 15 was extracted on the client or super early in the server 
process). I conclude that from the pdfinfo output on the file that I 
grab from the spool directory when I suspend the queue.
2. As far as I understand the first filter that is called is pdftopdf. 
Replacing the binary with a shell script that dumps the command line 
arguments, I see that the parameter "page-ranges=15" is passed.
3. The pdftopdf filter generates a broken output file. I conclude that 
from the pdfinfo output on the filter output file, which is:

-->--
$ pdfinfo /var/spool/cups/tmp/foomatic-MIDw3e
Syntax Error: Invalid page count 0
Command Line Error: Wrong page range given: the first page (1) can not 
be after the last page (0).
--<--

Is it possible that pdftopdf tries to extract page 15 from a document 
that was already stripped down to the single desired page? How could I 
address this? It looks like a potential incompatibility between 
versions, i.e. something changed, but I'm a bit surprised to be the only 
one affected by this. What else could it be? What info do you need to 
point me to the right direction?

Regards and thank you

Matt


More information about the cups mailing list