PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Apr 27, 2024 4:47 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: Tue Nov 07, 2023 3:23 pm 
Offline

Joined: Tue Nov 07, 2023 3:01 pm
Posts: 1
Hello,

I am using PdfSharp 1.50.5147 on a UWP app through NuGet. It works well for the most part.

But for some of the files that were produced on MacOS environment, when I call this PdfReader.Open(inStream, PdfDocumentOpenMode.Import); function, I'm getting the following error.
Invalid entry in XRef table, ID=8, Generation=0, Position=0, ID of referenced object=4, Generation of referenced object=0
at PdfSharp.Internal.ParserDiagnostics.ThrowParserException(String message)
at PdfSharp.Pdf.IO.Parser.ReadXRefTableAndTrailer(PdfCrossReferenceTable xrefTable)
at PdfSharp.Pdf.IO.Parser.ReadTrailer()
at PdfSharp.Pdf.IO.PdfReader.Open(Stream stream, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider passwordProvider)


I can open these files on the Adobe tools and browsers and once saved with the Adobe tools, the above function starts to work with those files.

Looking forward to hearing from you

Thank you


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 08, 2023 8:25 am 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 916
Location: CCAA
borancy wrote:
I can open these files on the Adobe tools and browsers and once saved with the Adobe tools, the above function starts to work with those files.
The file is corrupted.
The strict check has been removed from newer versions of PDFsharp (I don't remember when).
So either get the latest version of PDFsharp or take the source code of PDFsharp 1.5 and comment that check out.
I don't know if version 1.51 still has that check.

_________________
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  [ 2 posts ] 

All times are UTC


Who is online

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