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

Better error message for zero-sized file #5887

Closed
tob2 opened this issue Mar 27, 2015 · 2 comments · Fixed by #11398
Closed

Better error message for zero-sized file #5887

tob2 opened this issue Mar 27, 2015 · 2 comments · Fixed by #11398

Comments

@tob2
Copy link

tob2 commented Mar 27, 2015

EDIT: It turns out that the file is really broken: It is a size-zero file! I think there should be a better message if the file is zero or doesn't start with the "%PDF" marker. The current mesage implies that PDF.js has an issue - while the file has the issue.

That's with PDF.js as shipping with Firefox 36 under Linux.

The PDF file under http://www.bundesnetzagentur.de/cae/servlet/contentblob/38252/publicationFile/2591/Mitteilung902005VerzeichniId1323pdf.pdf doesn't render at all - only the dark background and is shown. The web console shows:

"Error: stream must have data" pdf.worker.js:250:4
"assert@resource://pdf.js/build/pdf.worker.js:267:5
init@resource://pdf.js/build/pdf.worker.js:2312:5
PDFDocument@resource://pdf.js/build/pdf.worker.js:2303:7
NetworkPdfManager@resource://pdf.js/build/pdf.worker.js:1975:24
getPdfManager@resource://pdf.js/build/pdf.worker.js:32962:24
wphSetupDoc@resource://pdf.js/build/pdf.worker.js:33157:7
messageHandlerComObjOnMessage@resource://pdf.js/build/pdf.worker.js:1219:9
" pdf.worker.js:252:0
"Warning: Unsupported feature "unknown"" pdf.worker.js:235:4
"Warning: Unsupported feature "unknown"" pdf.js:235:4

PDF.js Version 1.0.937 (build: 308646d)

@tob2 tob2 changed the title Completely fails to render PDF file ("Error: stream must have data") Better error message for zero-sized file Mar 27, 2015
@mbbaig
Copy link
Contributor

mbbaig commented May 17, 2015

I would like to work on this bug. Can someone point me into the right direction? How would the devs like this implemented?

@timvandermeij
Copy link
Contributor

Marking this as a feature since it does not concern a PDF file here and the message itself ("stream must have data") is correct, but might be made more explicit in that case. Not a high priority though.

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

Successfully merging a pull request may close this issue.

4 participants