Bug 86063

Summary: pdfseparate breaks xref table
Product: poppler Reporter: hans <hans>
Component: utilsAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: OpenBSD   
Whiteboard:
i915 platform: i915 features:
Attachments: A PDF file with two pages
An input PDF file with two pages
The first page, extracted by pdfseparate
The second page, extracted by pdfseparate
write correct size in trailer dict

Description hans@stare.cz 2014-11-09 15:56:33 UTC
Created attachment 109153 [details]
A PDF file with two pages

The PDF files produced by pdfseparate appear to have a broken xref table.
It is trivially repeatable - an input file and two page files attached,
process with "pdfseparate file.pdf page-%d.pdf"

For example, this is what mupdf says when trying to view such a file:

$ mupdf page-1.pdf
warning: broken xref section, proceeding anyway.
warning: ... repeated 2 times ...

This happens with all files I have tried.
Comment 1 hans@stare.cz 2014-11-09 15:59:25 UTC
Created attachment 109154 [details]
An input PDF file with two pages
Comment 2 hans@stare.cz 2014-11-09 16:00:07 UTC
Created attachment 109155 [details]
The first page, extracted by pdfseparate
Comment 3 hans@stare.cz 2014-11-09 16:01:01 UTC
Created attachment 109156 [details]
The second page, extracted by pdfseparate
Comment 4 hans@stare.cz 2014-11-09 16:01:47 UTC
This is on 0.26.5 as installed by the OpenBSD port.
Comment 5 Thomas Freitag 2014-11-10 09:37:03 UTC
I think You should ask the mupdf developper why mupdf means that the xref section is broken. I looked into the PDFs with a text editor and can't find any problems in the separated pages, poppler can use these PDFs without any problems and even acrobat reader and/or professional doesn't find any problems.
Comment 6 hans@stare.cz 2014-11-10 11:31:57 UTC
Here is a description of what exactly is wrong with the file:

http://bugs.ghostscript.com/show_bug.cgi?id=695672
Comment 7 Thomas Freitag 2014-11-10 12:56:40 UTC
Created attachment 109218 [details] [review]
write correct size in trailer dict

Okay, the mupdf developper are right. Haven't encountered that until now because nobody cares beside mupdf.

@Albert: this patch writes the correct size entry in the trailer dict according spec 32000-1
Comment 8 Albert Astals Cid 2014-11-13 11:27:02 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.