PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.com/

The file may be corrupt - BlobstreamReader
http://forum.pdfsharp.com/viewtopic.php?f=2&t=4006
Page 1 of 1

Author:  sabs [ Wed Aug 21, 2019 6:39 pm ]
Post subject:  The file may be corrupt - BlobstreamReader

I'm getting the below exception:

"Unexpected token '' in PDF stream. The file may be corrupted. If you think this is a bug in PDFsharp, please send us your PDF file."

while using the PdfSharp Nuget package, for a file that is not corrupt.

The PdfReader.Open method is being passed a WindowsAzure.Storage.Blob.BlobReadStream stream and InformationOnly access mode.

Has anyone encountered this, and what is the solution

Author:  Thomas Hoevel [ Thu Aug 22, 2019 9:18 am ]
Post subject:  Re: The file may be corrupt - BlobstreamReader

Hi!
sabs wrote:
[…] for a file that is not corrupt.
Then it must be a bug in PDFsharp - a bug we cannot replicate and thus cannot fix.

Author:  Traceymaule [ Thu Aug 06, 2020 2:54 am ]
Post subject:  Re: The file may be corrupt - BlobstreamReader

I am experiencing the same issue, using BlobReadStream in PdfReader.Open(blobStream);

Unexpected token 'eùY' in PDF stream. The file may be corrupted. If you think this is a bug in PDFsharp, please send us your PDF file.


Did you ever find the cause? (dispite the helpful comment from the PDFSharp team)
My file is 4MB so I cannot upload here

NOTE: I am able to open the same PDF from a local directory using FileStream,

Author:  TH-Soft [ Thu Aug 06, 2020 8:39 am ]
Post subject:  Re: The file may be corrupt - BlobstreamReader

Traceymaule wrote:
NOTE: I am able to open the same PDF from a local directory using FileStream,
Open the file with Adobe Reader and save it. If it works with the new file then the original file is likely corrupted.

Not much we can do if people are sure their file is not corrupt, but they do not share it.
Shared files usually were corrupted.

Author:  TH-Soft [ Thu Aug 06, 2020 1:18 pm ]
Post subject:  Re: The file may be corrupt - BlobstreamReader

Traceymaule wrote:
NOTE: I am able to open the same PDF from a local directory using FileStream,
If it works with one type of stream, but fails with another, then maybe there is a problem with the encoding that is used to open the file or BLOB respectively.

If the length of the stream does not match the size of the file, then this could indicate an encoding problem. But it could be an encoding problem even if sizes match.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/