PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Dec 04, 2020 4:56 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Wed Aug 21, 2019 6:39 pm 
Offline

Joined: Wed Aug 21, 2019 6:33 pm
Posts: 1
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


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 22, 2019 9:18 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3047
Location: Cologne, Germany
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.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 06, 2020 2:54 am 
Offline

Joined: Thu Aug 06, 2020 2:51 am
Posts: 1
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,


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 06, 2020 8:39 am 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 593
Location: CCAA
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.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 06, 2020 1:18 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 593
Location: CCAA
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.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 23 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group