foomatic-rip doesn't generate PAGE messages for page_log

Bug #1585380 reported by Alex Korobkin
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cups-filters (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

When a job is being processed by foomatic, foomatic is supposed to produce PAGE messages to CUPS to indicate how many pages were printed. [1] Otherwise CUPS doesn't write a message to the page_log with the page job accounting, as explained by Mike Sweet: [2] [3]

Please make foomatic-rip do that so that pages were accounted properly in the logs.

1. https://www.cups.org/documentation.php/doc-2.1/man-filter.html
2. http://www.cups.org/pipermail/cups/2009-April/018592.html
3. https://github.com/apple/cups/issues/4798#issuecomment-221369859

Revision history for this message
Alex Korobkin (korobkin) wrote :

I'm looking through the code for this (cups-filters 1.8.3, CUPS 2.1.3), and it seems like foomatic-rip is actually trying to insert some accounting (error_log):

[Job 29] Found: %%EndSetup
[Job 29] Inserting PostScript code for CUPS\' page accounting
[Job 29] -----------
[Job 29] New page: %%Page: 1 1
[Job 29] Found: %%BeginPageSetup

which is referenced in this prolog code, spooler.c, line 135:
http://bzr.linuxfoundation.org/loggerhead/openprinting/cups-filters/annotate/head:/filter/foomatic-rip/spooler.c#L135

but somehow nothing gets inserted.

ps_accounting is set to 1 in /etc/foomatic/filter.conf

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Can you please attach your full error_log file? As described in the error_log section of

https://wiki.ubuntu.com/DebuggingPrintingProblems

Please also attach the PPD fiule associated to your printer (from /etc/cups/ppd/).

Changed in cups-filters (Ubuntu):
status: New → Incomplete
Revision history for this message
Alex Korobkin (korobkin) wrote :

PPD: http://www.openprinting.org/ppd-o-matic.php?driver=Postscript-NRG&printer=NRG-MP_C3502&show=1 (attached)

error_log for the job attached, too (date/time removed for clarity).

Revision history for this message
Alex Korobkin (korobkin) wrote :
Revision history for this message
Alex Korobkin (korobkin) wrote :

foomatic.log

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Fixed missing page logging facility in cups-filters for pdftopdf (PDF printers), foomatic-rip (old method worked only for old PostScript workflow and only with Ghostscript), and gstopxl (simple Ghostscript wrapper script). BZR rev. 7468. Will be included in 1.9.0 release (in the next days).

Changed in cups-filters (Ubuntu):
status: Incomplete → In Progress
Revision history for this message
Alex Korobkin (korobkin) wrote :

Does it really launch GhostScript to determine the number of pages, or am I reading wrong code updates?

If yes, would it be possible to use qpdf library to get the number of pages? GS is so resource-intensive that I 'd prefer to avoid it on my busy printservers if possible.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

No, foomatic-rip launches Ghostscript to convert PDF or PostScript into the printer's native language using the built-in drivers of Ghostscript. Formerly when the print data was always sent in PostScript format one made use of the fact that PostScript is a full programming language and so one could hook the code for counting the pages into the call for termination of a page.

As there are some PPDs using foomatic-rip but in a way that it does not call Ghostscript and now the print data is also supplied in PDF and not in PostScript any more, the mentioned mechanism for counting pages does not work any more. Therefore we pass the job of counting pages over to pdftopdf as pdftopdf treats each page individually with QPDF and so it is able to count the pages easily.

There was never a call of Ghostscript solely for counting the pages.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

cups-filters 1.9.0 with the page accounting fixed is uploaded to the Debian package repositories and will soon get synced into Ubuntu Yakkety.

Changed in cups-filters (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cups-filters - 1.9.0-1

---------------
cups-filters (1.9.0-1) unstable; urgency=medium

  * New upstream release
   - pdftopdf: Added functionality for logging pages in the
     /var/log/cups/page_log file. Logging can also be forced or suppressed via
     command line (page-logging=on/off/auto) and page logging is also done for
     filters which should do but actually do not do: foomatic-rip, gstopxl,
     hpps (CUPS issue #4798, LP: #1585380)
   - cups-browsed: Added "Requires=cups-service" to the cups-browsed.service
     file, so that systemd keeps CUPS running while shutting down cups-browsed
     on system shutdown (LP: #1579905)
   - cups-browsed/sys5ippprinter: Fixed documentation about the allowed input
     formats for auto-created network printer queues using sys5ippprinter, also
     improved NEWS entry about renaming of sys5ippprinter (Closes: #819665)

  [ Till Kamppeter ]
  * Added Conflicts:/Replaces:/Provides: foomatic-filters-beh to the
    cups-filters binary package due to the fact that the beh backend is now
    part of cups-filters (LP: #1563686, Closes: #816700)

  [ Didier Raboud ]
  * Bump S-V to 3.9.8 without changes needed

 -- Didier Raboud <email address hidden> Thu, 09 Jun 2016 22:16:37 +0200

Changed in cups-filters (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Alex Korobkin (korobkin) wrote :

Thank you, I can confirm that it works for me both for PDF and PS printers.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.