Gottox / node-pdfutils

tool for analyzing and converting PDF
103 stars 23 forks source link

crash on truncated file #18

Closed yukulele closed 6 years ago

yukulele commented 10 years ago

wen pdfutils is called on truncated file (for example, during FTP upload) it should emit an error but it simply crash.

message show before crash:

Error: PDF file is damaged - attempting to reconstruct xref table...
Error: Couldn't find trailer dictionary
Error: Couldn't read xref table

(process:13600): Poppler-CRITICAL **: int poppler_document_get_n_pages(PopplerDocument*): assertion `POPPLER_IS_DOCUMENT (document)' failed
Gottox commented 10 years ago

thanks for reporting!

Please review if master fixes this issue.

ghusse commented 9 years ago

I have the same issue, I tested master with no luck:

 Error: May not be a PDF file (continuing anyway)
 Error (2): Illegal character <21> in hex string
 Error (4): Illegal character <4f> in hex string
 [...]
 Error: PDF file is damaged - attempting to reconstruct xref table...
 Error: Couldn't find trailer dictionary
 Error: Couldn't read xref table
 (process:1363): Poppler-CRITICAL **: int poppler_document_get_n_pages(PopplerDocument*): assertion `POPPLER_IS_DOCUMENT (document)' failed
 Erreur de segmentation
Gottox commented 9 years ago

Thanks, I'm looking into it this week.