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

HP Scan invalid Length workaround #215

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

Conversation

mfazekas
Copy link

@mfazekas mfazekas commented May 3, 2022

Fixes: #191

It looks that some version of HP Scan produces invalid pdf files. Where the length value would point ot of the file.

8 0 obj
<</Length 2200
/Type
/Metadata
/Subtype 
/XML>>
stream
endstream
endobj

I've added a new relaxed: option to allow read such files.
Not sure if it's any better than #209. More complicated for sure.
Also if we'd need the new option for this?

@RBIII
Copy link

RBIII commented Jul 12, 2022

Any idea when this might merge? I added it to my local and it seems to be working

@juliolinarez
Copy link

Works for me. Nice solution

@osvaldoalvaradodev
Copy link

Any idea when they merge into the main branch of this?

@mfazekas
Copy link
Author

@boazsegev I've now rebased the pr to current master

@boazsegev
Copy link
Owner

Does this actually solve cases where Length is invalid but still within the file's range?

Wouldn't it be better to test for endsteam and if it's not there search for it while ignoring the Length data?

@mfazekas
Copy link
Author

mfazekas commented Nov 15, 2023

@boazsegev thanks much for looking into it.

I've updated my PR:

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.

1.0.21 causes previously-consumable PDFs to fail now with RangeError
6 participants