-
Notifications
You must be signed in to change notification settings - Fork 153
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
parsing of PaperPort PDFs fails #36
Comments
Hi vitstradal, Thank you for reporting this issue! I have a busy day ahead of me, but I will try to look into it as soon as possible. |
Hi Vitstradal, I found the issue... PaperPort has an issue where PDF data will be placed within a PDF comment. PDF comments start with a "%" sign and end with an EOL marker ("\r" or "\n"). PaperPort ommitted the EOL marker, placing critical data within the comment. I wrote a work-around that parses the comment's data and attempts to salvage the misplaced critical information. This workaround assumes that comments would not contain PDF parsable data at the very end of the comment's line... which is an unsafe assumption. hence, if I get reports that this workaround breaks valid PDF files with comments, I might remove it! I'm running some tests and I will release an updated version shortly. |
I released the updated version (v. 0.2.12). It works on my computer... please let me know if it's working for you. |
I understand, buggy PaperPort, but what you want for €50 :-) Anyway: It is weird , that ordinal PDF viewer (evince for me) will parse it. Thank you very much. |
I'm happy this works for you :-) As for the original PDF viewer reading the file: At the end of the PDF file there is something called an X-Ref table. This table tells the PDF viewer the binary address of each object. Normally, PDF viewers follow the X-Ref table and find objects using their binary address (even if the data starts inside a comment line). But CombinePDF works a little differently - It reads the file to extract all the data by reading it completely, top to bottom, building a tree of objects as well as a list of objects... so that when you take a page out of the PDF, the fonts and the resources are automatically attached to that page (no need to search for them in the X-Ref table)... ...When I saw PaperPort's PDF, I was thinking about rewriting the parser to match binary viewers at some point (I believe I can still build a tree this way) - but it takes more work and I'm not sure how the performance might be effected... Maybe another time ;-) |
Hi,
I have PDF created by PaperPort 12 (probably http://www.nuance.com/imaging/paperport/paperport-upgrade-to-12.asp, but not sure), and
convert_pdf
create document with empty pages.How to reproduce:
more info:
The text was updated successfully, but these errors were encountered: