-
Notifications
You must be signed in to change notification settings - Fork 130
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
Stream cannot be read. Please send us the PDF file so that we can fix this (issues (at) pdfsharp.net). #200
Comments
We did not get the error you reported, but observed huge performance issues, when reading the file. We aborted the process after two hours. We fixed that performace issues, that slowed down loading of objects from object streams, for the next release of PDFsharp. Loading the file now finishes after eight seconds. |
I did not see performance issues because it immediately failed to load. It's interesting that you could open it. I was able to load it with itext just fine but not pdfsharp. Looping through thousands of pdf documents, this was the only one that would fail and it always failed with the error indicated in the issue title. |
Which version of PDFsharp are you using? GDI? WPF? Core? 6.1.0? 6.1.1? 6.2.0 Preview 1? |
We now tried to reproduce your issue by loading the file from an Azure File Storage. However, we still did not get the error you reported, but an Azure exception when PDFsharp tries to get the stream length: We tried it with the "PDFsharp" nuget packages of version 6.1.1 and 6.2.0-preview-1. |
No worries. It's odd that all of the other files we retrieve come from azure file storage worked fine coming straight from the stream. If it makes any difference, the method we're using to retrieve the stream from azure is ShareFileClient.OpenReadAsync(). I would assume that by copying the stream to a memory stream, we're introducing additional memory overhead, which I'd like to avoid. Either way, I appreciate you looking into this! |
Interesting. Using ShareFileClient.OpenReadAsync() I get the error you described, using ShareFileClient.DownloadAsync() I get the NotSupportedException when accessing Length. |
2024-Compliance-Supplement-V1.pdf
Reporting an Issue Here
Expected Behavior
The document should be read just fine. I can open it in Adobe, Chrome, Edge.
Actual Behavior
I get the error indicated in the title of this post.
Steps to Reproduce the Behavior
Stream coming directly from Azure File Share. I can confirm this code works against all of our other documents.
PdfDocument inputDocument = PdfReader.Open(streamcontent, PdfDocumentOpenMode.Import);
I'm using the latest preview version (6.2.0-preview-1) and have also tried the latest non-preview version. Both throw the same error.
Any ideas?
The text was updated successfully, but these errors were encountered: