CUPS cannot print PDF files nor can PDF files be added to faxes with hp-sendfax

Bug #182379 reported by Till Kamppeter
6
Affects Status Importance Assigned to Milestone
HPLIP
Invalid
Undecided
Unassigned
cupsys (Ubuntu)
Fix Released
High
Unassigned

Bug Description

I am using HPLIP 2.7.12 on Hardy.

Due to the many recent fax problems I opened hp-sendfax and tried to add files to the list. JPG, text, and Postscript work without problems, but it is impossible to add PDFs. I always get an error box telling "Render Failure: Rendered document contains no data." after some seconds of processing. The file does not get added to the list. I tried with various PDFs from different sources. evince displays the PDFs correctly.

Changed in hplip:
status: New → Invalid
Changed in cupsys:
importance: Undecided → Medium
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I have investigated this case more and found out that the problem is in the CUPS filter chain. CUPS of Ubuntu Hardy does not print PDFs at all.

See the attached error_log file.

It seems that the command line syntax of the pdftops filter of XPDF/Poppler has changed and so the CUPS filter /usr/lib/cups/filter/pdftops needs an update.

I will contact the upstream author of this filter, Helge Blischke, to get an update.

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

The /usr/bin/pdftops filter is version 3.00 from poppler-utils 0.6.2-1.

Changed in cupsys:
importance: Medium → High
Revision history for this message
Caroline Ford (secretlondon) wrote :

confirmed

Changed in cupsys:
status: New → Confirmed
Changed in cupsys:
milestone: none → ubuntu-8.04-beta
Revision history for this message
Aaron Albright (albrigha-deactivatedaccount) wrote :
Download full text (9.6 KiB)

I have also confirmed this.

Problem: pdftops is failing when trying to fax pdf's from hplip 2.8.2.

Steps:
Fully updated system
Install latest hplip 2.8.2 from source
--although hplip isn't causing this problem, so the hplip version wont matter
Attempt to send a fax using hp-sendfax
--you will likely get an error that rendering fail.
Check cups (locahost:631/printers) notice error: "/usr/lib/cups/filter/pdftops failed" for the fax queue.

Expected: pdftops should convert the pdf to ps with no errors.

I believe this problem is because pdftops no longer supports the -cfg option, and it is still getting passed the option from cupsys (I assume cupsys anyway.)

Verified pdftops file.pdf file.ps works correctly. pdftops is correctly converting pdf files to ps.

From the cups log:

E [21/Feb/2008:15:41:30 -0800] [Job 7] pdftops-options: -cfg /etc/cups/pdftops.conf
D [21/Feb/2008:15:41:30 -0800] Discarding unused printer-state-changed event...
D [21/Feb/2008:15:41:30 -0800] [Job 7] pdftops version 3.00
D [21/Feb/2008:15:41:30 -0800] [Job 7] Copyright 1996-2004 Glyph & Cog, LLC
D [21/Feb/2008:15:41:30 -0800] [Job 7] Usage: pdftops [options] <PDF-file> [<PS-file>]
D [21/Feb/2008:15:41:30 -0800] [Job 7] -f <int> : first page to print
D [21/Feb/2008:15:41:30 -0800] [Job 7] -l <int> : last page to print
D [21/Feb/2008:15:41:30 -0800] [Job 7] -level1 : generate Level 1 PostScript
D [21/Feb/2008:15:41:30 -0800] [Job 7] -level1sep : generate Level 1 separable PostScript
D [21/Feb/2008:15:41:30 -0800] [Job 7] -level2 : generate Level 2 PostScript
D [21/Feb/2008:15:41:30 -0800] [Job 7] -level2sep : generate Level 2 separable PostScript
D [21/Feb/2008:15:41:30 -0800] [Job 7] -level3 : generate Level 3 PostScript
D [21/Feb/2008:15:41:30 -0800] [Job 7] -level3sep : generate Level 3 separable PostScript
D [21/Feb/2008:15:41:30 -0800] [Job 7] -eps : generate Encapsulated PostScript (EPS)
D [21/Feb/2008:15:41:30 -0800] [Job 7] -form : generate a PostScript form
D [21/Feb/2008:15:41:30 -0800] [Job 7] -opi : generate OPI comments
D [21/Feb/2008:15:41:30 -0800] [Job 7] -noembt1 : don't embed Type 1 fonts
D [21/Feb/2008:15:41:30 -0800] [Job 7] -noembtt : don't embed TrueType fonts
D [21/Feb/2008:15:41:30 -0800] [Job 7] -noembcidps : don't embed CID PostScript fonts
D [21/Feb/2008:15:41:30 -0800] [Job 7] -noembcidtt : don't embed CID TrueType fonts
D [21/Feb/2008:15:41:30 -0800] [Job 7] -preload : preload images and forms
D [21/Feb/2008:15:41:30 -0800] [Job 7] -paper <string> : paper size (letter, legal, A4, A3, match)
D [21/Feb/2008:15:41:30 -0800] [Job 7] -paperw <int> : paper width, in points
D [21/Feb/2008:15:41:30 -0800] [Job 7] -paperh <int> : paper height, in points
D [21/Feb/2008:15:41:30 -0800] [Job 7] -nocrop : don't crop pages to CropBox
D [21/Feb/2008:15:41:30 -0800] [Job 7] -expand : expand pages smaller than the paper size
D [21/Feb/2008:15:41:30 -0800] [Job 7] -noshrink : don't shrink pages larger than the paper size
D [21/Feb/2...

Read more...

Revision history for this message
Aaron Albright (albrigha-deactivatedaccount) wrote :

Sorry I also wanted to note that the command " pdftops -cfg /etc/cups/pdftops.conf cmyk.pdf cmyk2.ps" (for example) also errors out. It it strongly appears to be the -cfg option is no longer valid.

aaron@localhost:~/Desktop$ pdftops -cfg /etc/cups/pdftops.conf cmyk.pdf cmyk2.ps
pdftops version 3.00
Copyright 1996-2004 Glyph & Cog, LLC
Usage: pdftops [options] <PDF-file> [<PS-file>]
  -f <int> : first page to print
  -l <int> : last page to print
  -level1 : generate Level 1 PostScript
  -level1sep : generate Level 1 separable PostScript
  -level2 : generate Level 2 PostScript
  -level2sep : generate Level 2 separable PostScript
  -level3 : generate Level 3 PostScript
  -level3sep : generate Level 3 separable PostScript
  -eps : generate Encapsulated PostScript (EPS)
  -form : generate a PostScript form
  -opi : generate OPI comments
  -noembt1 : don't embed Type 1 fonts
  -noembtt : don't embed TrueType fonts
  -noembcidps : don't embed CID PostScript fonts
  -noembcidtt : don't embed CID TrueType fonts
  -preload : preload images and forms
  -paper <string> : paper size (letter, legal, A4, A3, match)
  -paperw <int> : paper width, in points
  -paperh <int> : paper height, in points
  -nocrop : don't crop pages to CropBox
  -expand : expand pages smaller than the paper size
  -noshrink : don't shrink pages larger than the paper size
  -nocenter : don't center pages smaller than the paper size
  -duplex : enable duplex printing
  -opw <string> : owner password (for encrypted files)
  -upw <string> : user password (for encrypted files)
  -q : don't print any messages or errors
  -v : print copyright and version info
  -h : print usage information
  -help : print usage information
  --help : print usage information
  -? : print usage information

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

The CUPS wrapper script for the pdftops filter (/usr/lib/cups/filter/pdftops) seems to be for the XPDF edition of pdftops which supports the "-cfg" option.

Simply replacing poppler-utils by xpdf-utils (from universe) via

sudo apt-get install xpdf-utils

fixes the problem. Another possibility is using Ghostscript as PDF filter for CUPS, replacing /usr/lib/cups/filter/pdftops by the attached script. This way I even succeeded to print a 400-pages PDF which made pdftops crashing. Note that the attached Ghostscript-based PDF filter does not support all CUPS options.

So to fix this bug we have the following possibilities:

1. Replace poppler-utils by xpdf-utils. This would require a MIR for xpdf-utils
2. Patch poppler-utils with the "-cfg" functionality taken from xpdf-utils
3. Use a Ghostscript-based PDF filter. Note here that the attached script needs some improvement to support the PDF-filter-related CUPS options
4. Return to CUPS' original PDF filter (needs more space on CDs and requires more security updates as it duplicates XPDF/Poppler code)

WDYT? Which solution should we go for?

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

Mike Sweet, the author of CUPS, suggests his own wrapper from the CUPS 1.4.x SVN repository which works with the pdftops filters of both Poppler and XPDF.

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

Here is the C source of the pdftops wrapper from CUPS 1.4:

http://svn.easysw.com/public/cups/trunk/filter/pdftops.c

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

Note that the C source file mentioned above is development code for CUPS 1.4, so it contains once some bugs (http://www.cups.org/str.php?L2716) and second, it needs some modifications due to API changes. A patch fixing both problems is attached.

Changed in cupsys:
status: Confirmed → In Progress
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I have made a new CUPS package with the pdftops filter of CUPS 1.4 now. Also available at:

http://www.linux-foundation.org/~till/tmp/ubuntu/hardy/cupsys/

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

This bug was fixed in the package cupsys - 1.3.5-2ubuntu1

---------------
cupsys (1.3.5-2ubuntu1) hardy; urgency=low

  * debian/local/apparmor-profile: Added Kerberos authentication support
    to the AppArmor profile (LP: #189022).

cupsys (1.3.5-2) unstable; urgency=low

  [ Martin Pitt ]
  * debian/cupsys.init.d: Add Should-Start: avahi. (Closes: #459662)

  [ Till Kamppeter ]
  * debian/patches/pdftops-cups-1.4.dpatch, debian/local/filters/pdftops:
    Replaced Helge Blischke's alternative pdftops wrapper by the pdftops
    of CUPS 1.4. The old pdftops wrapper did not work with the pdftops
    filter of Poppler, the new one works with the pdftops filters of both
    Poppler and XPDF (Closes: #457810; Ubuntu LP: #182379).
  * debian/patches/web-interface-breaks-default-auth-setting.dpatch: When
    modifying server settings with the CUPS web interface, the setting
    for the default authentication got overwritten with gibberish
    (Closes: #461331; CUPS STR #2703, Ubuntu LP: #188426).
  * debian/local/backends/dnssd: Updated dnssd to filter out IPv6 entries,
    as they clutter the lists of detected printers and make the network
    printer discovery process taking more time than needed. Applied also
    a bug fix and the possibility of querying one IP address by calling
    the dnssd backend with the IP as command line argument (like the
    snmp CUPS backend).

 -- Till Kamppeter <email address hidden> Sat, 23 Feb 2008 18:01:06 +0100

Changed in cupsys:
status: Fix Committed → Fix Released
Revision history for this message
Piotr Bukowczyk (piotr-bukowczyk) wrote :

Pdf files opened with Evince cannot be also printed on Ubuntu 7.10.

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

Other bug subscribers

Bug attachments

Remote bug watches

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