Skip to content

Conversation

@eli-collins
Copy link

I ran into a print printer whose output appends a bunch of NULL characters after the %%EOF marker in it's PDFs. This tweaks PdfReader's EOF detector to ignore those like it does trailing whitespace.

Modified PdfReader's EOF detector to ignore trailing NULLs in addition to whitespace.
@pmaupin
Copy link
Owner

pmaupin commented Jun 11, 2018

Thanks for the patch! I have no problem with stripping trailing nulls, but to avoid any chance of regression, I would prefer not to stop stripping other characters which the current version would strip. Python's definition of whitespace includes vertical tabs and form feeds, so I think the characters to be stripped should include '\x0b\x0c'

@eli-collins
Copy link
Author

Sigh. I'm always forgetting those. I'm glad you caught that!

@soferio
Copy link

soferio commented Jun 25, 2018

We had the same issue with any file printed from Chrome on Windows 10. This will be a great patch. Thanks! (BTW, would it make sense to strip everything after the final %%EOF?)

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.

3 participants