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

System.InvalidOperationException: 'Stream cannot be read. Please send us the PDF file so that we can fix this (issues (at) pdfsharp.net).' #148

Open
robrechtD opened this issue Aug 9, 2024 · 2 comments
Labels
enhancement New feature or request support

Comments

@robrechtD
Copy link

Opening a pdf from a stream produces the following exception:

System.InvalidOperationException: 'Stream cannot be read. Please send us the PDF file so that we can fix this (issues (at) pdfsharp.net).'
I've attached a project to reproduce the issue.

PDFsharp.IssueSubmissionTemplate.zip

@ThomasHoevel
Copy link
Member

Thanks for the feedback.
The PDF file is corrupted in object 14 0.
The object has an empty stream, but the length is given as 2338 bytes and that's more bytes than there are remaining in the file.

14 0 obj
<</Length 2338
/Type
/Metadata
/Subtype 
/XML>>
stream
endstream

We try to improve PDFsharp with respect to reading corrupted files, but I cannot say if or when a workaround for that corruption will come.

@ThomasHoevel ThomasHoevel added enhancement New feature or request support labels Aug 9, 2024
packdat added a commit to packdat/PDFsharp-net6 that referenced this issue Aug 17, 2024
@packdat
Copy link

packdat commented Aug 17, 2024

@ThomasHoevel
I just added a commit to #152 that handles this situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request support
Projects
None yet
Development

No branches or pull requests

3 participants