Skip to content

Comments

Updated pdfreader to properly handle xref streams.#149

Open
JimBiardCics wants to merge 2 commits intopmaupin:masterfrom
JimBiardCics:master
Open

Updated pdfreader to properly handle xref streams.#149
JimBiardCics wants to merge 2 commits intopmaupin:masterfrom
JimBiardCics:master

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