PDF file is damanged - attempting to reconstruct xref table

Bug #939735 reported by Paul Sladen
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
bannertopdf
Fix Released
Undecided
Lars Karlitski
cups-filters (Ubuntu)
Fix Released
High
Unassigned

Bug Description

After hitting the "Test page" button the printer complains about the size (bug #921073):

But the local cups instance also shows the error:

  http://localhost:631/printers/Canon-iR-ADV-C5000s-B1-PS-V1.0
  "PDF file is damaged - attempting to reconstruct xref table..."

  Driver: Generic PostScript Printer Foomatic/Postscript (recommended) (color, 2-sided printing)
  Defaults: job-sheets=none, none media=iso_a4_210x297mm sides=one-sided

Is there an obvious way to hook the intermediate PDF out of eg. '/var/cache/cups/' ?

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in cups-filters (Ubuntu):
status: New → Confirmed
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I get this error, too, but I do not get complaints from Ghostscript or evince if I call bannertopdf on the command line and try to display the resulting file.

There is also the cupsfilter utility to debug filter chains, but using this I did not get "PDF file is damaged - attempting to reconstruct xref table...", only in a real CUPS queue environment.

Changed in cups-filters (Ubuntu):
importance: Undecided → High
Changed in bannertopdf:
status: New → Confirmed
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Sorry, now I get it with cupsfilter. Following command line reproduces it:

cupsfilter -P Photosmart-C8100-series.ppd -m application/vnd.cups-pdf -e /usr/share/cups/data/testprint > out.pdf

PPD file is attached.

To get the output of bannertopdf, run

cupsfilter -P Photosmart-C8100-series.ppd -m application/pdf -e /usr/share/cups/data/testprint > bannertopdf-out.pdf

Revision history for this message
Lars Karlitski (larsu) wrote :

Poppler uses ftell(3) to find out byte offsets for the xref table. CUPS makes all filters write to stdout, which cannot support ftell.

It didn't occur when calling `bannertopdf [args] > out.pdf` manually, because in this case stdout will be dup()ed to the file (hence supporting ftell again). That's why I didn't notice this while developing.

Fixed in r25.

Changed in bannertopdf:
status: Confirmed → Fix Committed
assignee: nobody → Lars Uebernickel (larsu)
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Great, thank you.

Testing and upstreamizing ...

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

Works. Upstreamized to the cups-filters BZR on OpenPrinting.

Changed in bannertopdf:
status: Fix Committed → Fix Released
Changed in cups-filters (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Fabian Köster (maestro-alubia) wrote :

I am getting this message on Precise when trying to print the testpage on Kyocera FS-1130D (default built-in driver).

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

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

---------------
cups-filters (1.0.4-1) unstable; urgency=low

  [ Till Kamppeter ]
  * New upstream release
    - cups-filters 1.0.4 release
    - texttopdf: Fall back to altermative fonts via fontconfig if the
      FreeMono TrueType fonts are not installed (Closes: #495598,
      Closes: #662660).
    - bannertopdf: Fix off-by-one error in page duplication
    - bannertopdf: Put indirect references to streams into the page's
      contents
    - bannertopdf: Let byte offsets for the Xref table of the PDF output
      being determined correctly also when the output goes to stdout
      (LP: #939735).
    - bannertopdf: Output multiple copies of the test page if duplex
      and/or N-up is chosen, to let the test page appear on all possible
      positions of the sheet (LP: #939530).
    - bannertopdf: Scale test page template to fit the job's page size,
      get and display full page geometry information, draw the frame which
      marks the printable area 1pt smaller, to assure that it gets completely
      visible (LP: #921073).
  * debian/local/default-testpage.pdf: Added missing "Q" operator to the end of
    the page. This broke N-up printing with pdftopdf (LP: #939530).
  * debian/control: Added explicit build dependency on libfontconfig1-dev.
    (Closes: #661127)
  * debian/control: Changed font dependency (for texttopdf) to "ttf-freefont |
    fonts-liberation | ttf-dejavu" instead of only "ttf-freefont"
    (Closes: #495598, Closes: #662660).

  [ Martin Pitt ]
  * debian/control: Build against libpng-dev, with an alternative to the older
    libpng12-dev. (Closes: #662295)
  * debian/control: Prefer building against libtiff5-dev if available, falling
    back to libtiff-dev.
  * debian/control, debian/rules: Move from hardening-wrapper to using
    dpkg-buildflags. Bump dpkg-dev build dependency to (>= 1.16.1~) for this.
  * debian/copyright: Update Format header for official copyright format 1.0.
  * debian/control: Bump Standards-Version to 3.9.3.
  * debian/rules: Drop LC_MESSAGES setting, leftover from cups.
  * debian/control: Bump libcupsimage2-dev build dependency to ensure to build
    against a version which does not conflict on the libtiff?-dev build
    dependency.
 -- Martin Pitt <email address hidden> Wed, 07 Mar 2012 14:36:49 +0100

Changed in cups-filters (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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