Bug 92508 - PDF not displayed except 1st page
Summary: PDF not displayed except 1st page
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
: 94260 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-10-17 17:04 UTC by Dimitri Papadopoulos
Modified: 2016-03-16 09:37 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Downloaded from http://downloads.avaya.com/css/P8/documents/100095593 (2.80 MB, text/plain)
2015-10-17 17:04 UTC, Dimitri Papadopoulos
Details
Call constructXRef if necessary xref can't be fetched (1.04 KB, patch)
2016-03-14 13:57 UTC, Thomas Freitag
Details | Splinter Review
Call constructXRef if necessary xref can't be fetched and the PDF don't use xref streams (1.06 KB, patch)
2016-03-15 14:39 UTC, Thomas Freitag
Details | Splinter Review

Description Dimitri Papadopoulos 2015-10-17 17:04:30 UTC
Created attachment 118937 [details]
Downloaded from http://downloads.avaya.com/css/P8/documents/100095593

The attached PDF file is not displayed in evince - except the 1st page.

Using poppler 0.30.0 and evince 3.16.1 on Fedora 22.

Bug report against evince already filed below but it appears to be a libpoppler bug:
https://bugzilla.gnome.org/show_bug.cgi?id=742692
Comment 1 Dimitri Papadopoulos 2015-10-17 17:09:08 UTC
Bug can be reproduced easily this way:

$ pdftocairo -png /NN46240-710_01.01_Troubleshooting-VPN.pdf 
Syntax Error: font resource is not a dictionary
Syntax Error: font resource is not a dictionary
Syntax Error: XObject 'Im0' is unknown
Syntax Warning: Object (1 0) is not a pageDict
Syntax Warning: Failed parsing page 2 using hint tables
Syntax Error: Top-level pages object is wrong type (null)
Syntax Warning: Object (1 0) is not a pageDict
Syntax Warning: Failed parsing page 2 using hint tables
Syntax Error: Top-level pages object is wrong type (null)
Syntax Warning: Object (1 0) is not a pageDict
Syntax Warning: Failed parsing page 2 using hint tables
Syntax Error: Top-level pages object is wrong type (null)
Syntax Warning: Object (1 0) is not a pageDict
Syntax Warning: Failed parsing page 2 using hint tables
Syntax Error: Top-level pages object is wrong type (null)
Syntax Warning: Object (1 0) is not a pageDict
Syntax Warning: Failed parsing page 2 using hint tables
Syntax Error: Top-level pages object is wrong type (null)
libpng warning: Image width is zero in IHDR
libpng warning: Image height is zero in IHDR
libpng error: Invalid IHDR data
Internal Error: Error during writing header
Error writing NN46240-710_01.01_Troubleshooting-VPN-002.png
$
Comment 2 Thomas Freitag 2016-03-14 13:54:48 UTC
*** Bug 94260 has been marked as a duplicate of this bug. ***
Comment 3 Thomas Freitag 2016-03-14 13:56:05 UTC
The PDF is broken but the reconstruction algorithm of poppler is not called!
Comment 4 Thomas Freitag 2016-03-14 13:57:17 UTC
Created attachment 122276 [details] [review]
Call constructXRef if necessary xref can't be fetched

This patch solves it
Comment 5 Albert Astals Cid 2016-03-15 11:10:22 UTC
That patch seems to regress the opening of file at https://bugs.freedesktop.org/attachment.cgi?id=27949
Comment 6 Thomas Freitag 2016-03-15 14:37:36 UTC
(In reply to Albert Astals Cid from comment #5)
> That patch seems to regress the opening of file at
> https://bugs.freedesktop.org/attachment.cgi?id=27949

Hmmh, yes, this PDF is broken: it references an AcroForm with num 1:
.../AcroForm 1 0 R ...
which the PDF doesn't contain. But this is not visible when rendering the PDF, so nobody complains.
But we can't call the constructXRef() for this PDF, because the PDF contains an ObjStm stream, and the poppler reconstruction algorithm doesn't work for PDF which contains ObjStm streams, the objects inside these streams are missing after the reconstruction algorithm.
To improve the reconstruction algorithm that it also handles ObjStm streams would be a bigger task, so I don't want to do that right now. So I decide to don't call constructXRef() in the case the PDF might contain an ObjStm stream. Since I can't detect if a PDF contains an ObjStm stream but an ObjStm stream is only possible if the PDF uses xref streams, I use this pointer.
Comment 7 Thomas Freitag 2016-03-15 14:39:26 UTC
Created attachment 122325 [details] [review]
Call constructXRef if necessary xref can't be fetched and the PDF don't use xref streams

This patch solves it and is more careful.
Comment 8 Albert Astals Cid 2016-03-16 09:37:26 UTC
Fix 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.