PDFsharp & MigraDoc Foundation

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

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Dec 05, 2018 3:51 pm 
Offline

Joined: Wed Dec 05, 2018 3:19 pm
Posts: 1
Location: AIS Novations
Hello

We face issue that PDF Sharp can’t open the PDF file that provided by our customer. Demo project can be downloaded here
https://galuza-my.sharepoint.com/:u:/g/ ... g?e=UW0hMy

We’re using nuget package PDFsharp.1.50.4845-RC2a via the following code snippet.
Code:
            try
            {
                using (var reader = PdfReader.Open(pdfPath, PdfDocumentOpenMode.ReadOnly))
                {
                }
            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.ToString());
                Console.ReadLine();
            }


Expected result:
Code:
no exception happens.


Actual result:
Code:
PdfSharp.Pdf.IO.PdfReaderException: Invalid entry in XRef table, ID=67, Generation=0, Position=0, ID of referenced object=4, Generation of referenced object=0


Could you please take a look into it?


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 06, 2018 3:09 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
Hi!
Siarhei Kuchuk wrote:
Could you please take a look into it?
The exception says the file is corrupt. I don't think there is more to say about it.
Adobe Reader does a good job opening (and fixing) corrupted files. PDFsharp was designed to handle intact files and has limited capabilities with respect to fixing corruption.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

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