Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pages without \Resources in their dictionary fail to load #4461

Closed
bthorben opened this issue Mar 14, 2014 · 1 comment
Closed

Pages without \Resources in their dictionary fail to load #4461

bthorben opened this issue Mar 14, 2014 · 1 comment
Labels

Comments

@bthorben
Copy link
Contributor

Consider this [1] simple PDF Document. It it's a tiny blank pages and loads fine in Reader, Preview.app and FoxIt. PDF.js though never stops spinning. The document is corrupted as its only page does not include an entry for "\Resources", which should be an empty dictionary if the page has no resources [2].

I believe PDF.js should treat a missing entry as being an empty dictionary and continue.

[1]

%PDF-1.4
%μῦ

1 0 obj
<</Parent 2 0 R/MediaBox[0 0 30 20]/Type/Page/Contents 3 0 R>>
endobj

2 0 obj
<</Kids[1 0 R]/Type/Pages/Count 1>>
endobj

3 0 obj
<</Length 0>>
stream
endstream
endobj

4 0 obj
<</Pages 2 0 R/Type/Catalog>>
endobj

xref
0 5
0000000000 65536 f 
0000000017 00000 n 
0000000096 00000 n 
0000000148 00000 n 
0000000195 00000 n 

trailer
<</Size 5/Root 4 0 R/ID[<1861E1AD51AD0FE751FE9A71F1C854F5><1861E1AD51AD0FE751FE9A71F1C854F5>]>>

startxref
241
%%EOF

[2] Adobe PDF Reference 1.7 p. 145, available at http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_reference_1-7.pdf

bthorben pushed a commit to bthorben/pdf.js that referenced this issue Mar 18, 2014
…fail to load

When no "\Resource" entry could be found return an empty dictionary
bthorben pushed a commit to bthorben/pdf.js that referenced this issue Mar 18, 2014
@yurydelendik
Copy link
Contributor

Fixed by #4464

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants