PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 3:39 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Failed to open PDF file
PostPosted: Tue Aug 22, 2017 1:13 pm 
Offline

Joined: Tue Aug 22, 2017 1:08 pm
Posts: 4
Hi,

I receive the following exception when I'm trying to open PDF file:
Quote:
Unexpected token 'xref' in PDF stream. The file may be corrupted. If you think this is a bug in PDFsharp, please send us your PDF file.


Here is the file which I'm trying to open: https://www.dropbox.com/s/3076hz16l19wcys/File.pdf


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 22, 2017 2:23 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
Hi!

I think the file is corrupt. The XREF table should contain a list to the objects of the PDF. In this case the XREF table includes a link to the XREF table (which is not an object and thus PDFsharp finds "xref" where it expects two integers).

Adobe Reader is better when it comes to dealing with corrupt files. Open the file with Adobe Reader, select "Save As" and the new file works with PDFsharp.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 22, 2017 3:59 pm 
Offline

Joined: Tue Aug 22, 2017 1:08 pm
Posts: 4
Thank you.


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 28, 2017 12:10 pm 
Offline

Joined: Tue Aug 22, 2017 1:08 pm
Posts: 4
Could you tell me whether this file has any issues?
https://www.dropbox.com/s/41youfiu0726v ... b92e8b.pdf

When I'm processing this file by using PDFSharp Family name is lost:

Code:
            using (var pdf = PdfReader.Open(inputPdf)) {
                ...
                pdf.Save(outputPdf);
            }


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 148 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