[cups] Print range confusion

Helge Blischke helgeblischke at web.de
Wed Jun 6 02:17:07 PDT 2018


> Am 05.06.2018 um 19:56 schrieb Mathias Weyland <mathias at weyland.ch>:
> 
> 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
> _______________________________________________

Please post the complete log file portion regarding the job on the client system. 
To make this easy, you might use the following Perl script:
———————
#!/usr/bin/perl -w
$jid=shift;
system ("grep \"Job $jid\" /var/log/cups/error_log.O | grep -v 'Set job-printer-state-message to' > /tmp/temp.log");
system ("grep \"Job $jid\" /var/log/cups/error_log | grep -v 'Set job-printer-state-message to' >> /tmp/temp.log");
system ("view /tmp/temp.log");
———————
This is to show which filters are involved on the client side. And, please, post the source PDF (off the list, as the list algorithm deletes all attachments but text files).

Helge




More information about the cups mailing list