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

Can't retrieve stream length error - in old version? #99

Closed
dangdkhanh opened this issue Apr 1, 2024 · 4 comments
Closed

Can't retrieve stream length error - in old version? #99

dangdkhanh opened this issue Apr 1, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@dangdkhanh
Copy link

dangdkhanh commented Apr 1, 2024

Hi,

Using one = PdfReader.Open(filepath, PdfDocumentOpenMode.Import)
one.Close()
End Using

This code threw an exception with the attached pdf.
Merge_1.1.pdf

I tried to build latest version but got an error.
Is there any way to fix?

Windows11-24H2
I cannot build the project. thanks you!

image

@StLange
Copy link
Member

StLange commented Apr 1, 2024

Hi dangdkhanh,

you are right, PDFsharp crashes while opening your file. We will fix this.

The second issue has obviously to do with gitversion. Sometimes it simply crashes when it founds no tag. Try check ‘git tag’. Should lists tags. If not, set one as described in README.md.

I tried cloning the PDFsharp repo from github in a new directory, run ‘.\dev\download-assets.ps1’ und ‘dotnet build’. Compiles on my Windows 10 machine. Then run ‘.\PdfSharp.sln’ and compile with VS. No problems. We will check it with Windows 11.

@ThomasHoevel ThomasHoevel added the bug Something isn't working label Apr 2, 2024
@StLange
Copy link
Member

StLange commented Apr 4, 2024

The producer app of your PDF file creates the MetaData dictionary without a stream length. So technically the file is no valid PDF. However, Acrobat accepts this file and correct it when saved. We fixed this equally in PDFsharp. It is in the next preview.
It did never work in a previous version of PDFsharp.

@dangdkhanh
Copy link
Author

Great,
Thanks you, Team!

@StLange
Copy link
Member

StLange commented May 7, 2024

Done in 6.1.0 Preview 3

@StLange StLange closed this as completed May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants