Skip to content

Conversation

@rpoelstra
Copy link

I've a PDF with a '%%EOF' comment that ends without a newline character. This caused a TypeError exception in comment() on line 187.
I've fixed this by including EOF (None) as a valid EOL marker.

If you accept this PR it would be great if you can make a new release also, so I can convert back to my normal workflow :)

@maxpmaxp
Copy link
Owner

@rpoelstra can you share the document with me please?

@rpoelstra
Copy link
Author

Unfortunately, I can't share this document due to sensitive information inside the document. Redacting the document removes the tricky situation which pdfreader is unable to handle.

But in essence this PR also treats EOF as EOL, which seems logical as a line cannot extend beyond the end of the document.

@maxpmaxp
Copy link
Owner

@rpoelstra let me rephrase my question then. Does your file end with %%EOF or does it have some other trailing characters after %%EOF?

@rpoelstra
Copy link
Author

The end of the file looks like this:
image

Note however, that there also exist PDF files without the '0a' at the end that parse fine, so it also seems to depend on the command structure inside the PDF.

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