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

Updated pdfreader to properly handle xref streams. #149

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JimBiardCics
Copy link

This change processes an XRefStream element if it is present in a trailer. It adds the references found within it before handling any 'previous' xref section specified in the trailer.

@JimBiardCics
Copy link
Author

@pmaupin Has my change caused the Travis failure? I've been using my mod with real-world PDF files with no problems. Do you have a sense of what is leading to the failure?

@JimBiardCics
Copy link
Author

@pmaupin My original pull request was failing the tests, and there was, in fact a bug in my code that I fixed. It's still failing, but I get a similar set of failures on my local machine when I run the tests with either your code or my modified version.

Particularly, I get the failures on the 5f0cff36d0ad74536a6513a98a755016.pdf tests and the 2ac7c68e26a8ef797aead15e4875cc6d.pdf tests. I don't get the failure on the platypus template test.

My failures on the 5f0cff36d0ad74536a6513a98a755016.pdf tests match those in the Travis CI output. (By the way, this file has an xref stream section, so my code changes get exercised on it.)

The other failure I get on my local machine (it's a Mac with Anaconda Python 3.5) is on the 2ac7c68e26a8ef797aead15e4875cc6d.pdf file. All those tests fail with the message:
pdfrw.errors.PdfParseError: Invalid PDF header: "Doc direct None None ['/Size', '/ID', '/Info', '/Root']"

@pmaupin
Copy link
Owner

pmaupin commented Sep 13, 2018

It's possible that a new version of reportlab causes the failure. I might be able to look at this in a couple of weeks. The main branch wasn't failing last time I did any work on it, but that was a very long time ago.

Thanks,
Pat

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

Successfully merging this pull request may close these issues.

2 participants