Bug 58569 - Regression in pdfunite
Summary: Regression in pdfunite
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: utils (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
: 58785 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-12-20 11:57 UTC by Adrian Johnson
Modified: 2012-12-28 00:19 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Repair pdfunite (4.00 KB, patch)
2012-12-27 16:08 UTC, Thomas Freitag
Details | Splinter Review

Description Adrian Johnson 2012-12-20 11:57:57 UTC
Testing with this pdf:

  http://dl.rom1v.com/misc/sequences_zigomar.pdf

from https://bugzilla.gnome.org/show_bug.cgi?id=600357

Using master, I executed the following commands:

pdfseparate -f 1 -l 2 sequences_zigomar.pdf page-%d.pdf
pdfunite page-1.pdf page-2.pdf combined.pdf

When opening combined.pdf in acroread, the second page is rendered blank. Poppler will render the second page but prints a lot of errors eg

Syntax Error: Couldn't find trailer dictionary
Syntax Error: Invalid XRef entry
Syntax Error: font resource is not a dictionary
Syntax Error: Invalid XRef entry
Syntax Error (45383): Bad 'Length' attribute in stream
Syntax Error: Unknown font tag 'R20'
Syntax Error (54240): No font in show

The individual pages (page-1.pdf and page-2.pdf) render correctly in acroread and poppler without errors.

Running the same commands using 0.18.4 works fine. I git bisected and the offending commit is:

  commit c470a3929c0a02b8a543fcada22138ab1fc18176
  Author: Thomas Freitag <Thomas.Freitag@alfa.de>
  Date:   Mon Sep 17 23:13:48 2012 +0200

      Support encrypted pdf files in pdfseparate

I tested again after reverting c470a392 on master and it works fine.
Comment 1 Albert Astals Cid 2012-12-26 21:48:21 UTC
*** Bug 58785 has been marked as a duplicate of this bug. ***
Comment 2 Thomas Freitag 2012-12-27 16:08:54 UTC
Created attachment 72188 [details] [review]
Repair pdfunite

Sorry, when I implemented the support encrypted pdf files in pdfseparate I missed that writePageObjects of course is also used in pdfunite for combining pages, and even more that encrypted files are still not supported by pdfunite, I removed the numoffset from writing the objects itself. Therefore there are still all objects in the combined pdf file, but the references missing the numoffset and therefore were no more reachable.
The patch repairs it.
Comment 3 Albert Astals Cid 2012-12-28 00:19:21 UTC
Pushed!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.