PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat May 25, 2024 8:58 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Sat Jun 19, 2021 9:20 am 
Offline

Joined: Sat Jul 29, 2017 11:53 am
Posts: 11
Hello,

There is a PDF file which I was able to open properly using v1.32 of PDFsharp but it failed to open using v1.50 stable :(.

Result of attempt to open the file:
PdfSharp.Pdf.IO.PdfReaderException: Invalid entry in XRef table, ID=5, Generation=0, Position=0, ID of referenced object=1, Generation of referenced object=0

I don't know to explain how, but opening the file properly using v1.32, then saving the file and then attempting to open the saved version using v1.50 was the solution to resolve that automatically (otherwise, saving as using Adobe reader).

It's quite strange to say that the file could be opened properly using an earlier version (and somehow the earlier version "fixed" the file on saving).
Do you have an idea?

I believe you probably need the file for testing...

Thank you for your attention!


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 04, 2022 1:21 pm 
Offline

Joined: Tue Jan 04, 2022 1:15 pm
Posts: 5
@ta221 We have exactly the same problem. We have quite a few pdfs that can be opened using PdfSharp version 1.31.1789.0 but cannot be opened with version 1.50.5147 (error = Invalid entry in XRef table, ID=xx, Generation=0, Position=0)

I have yet to try your solution or latest beta version 1.51.5185.

Have you found anything else regarding the matter?


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 05, 2022 7:01 pm 
Offline

Joined: Tue Jul 05, 2022 6:59 pm
Posts: 1
This problem still exists. For now, I'm using 1.32 but I would like to update it. Have someone found a solution?


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 13, 2022 6:56 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3098
Location: Cologne, Germany
The PDF files are corrupt.
Version 1.50 makes more consistency checks than version 1.32.
You can take the latest source code and disable the consistency check.

The files should work fine when you open them with Adobe Reader and use "Save as" in Adobe Reader to let it fix the inconsistency.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 11, 2023 7:41 am 
Offline

Joined: Wed Oct 11, 2023 7:32 am
Posts: 1
Hello,

Does anyone has any news about the "Invalid entry in XRef table" problem with v1.50.5147 stable?
When I try to open a PDF with such a problem in V1.32, it normally opens (but I need functionality from v1.50).
When I open the PDF with acrobat reader and save it with acrobat reader, the PDF can normally be opened with v1.50. But I have an automated system without user interaction.
I've also tried to use Acrobat Reader from the command line, but I can't see any ways to open and save the PDF file with command line options.

For opening some PDF files, I'm stuck with using PdfSharp at this moment (I've checked with online tools if the PDF's are corrupt, and they are not).

Any help and/or workarounds are really appreciated.

Thanks!


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 11, 2023 9:01 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3098
Location: Cologne, Germany
SHunter007 wrote:
Does anyone has any news about the "Invalid entry in XRef table" problem with v1.50.5147 stable?
v1.50 no longer receives updates.
How about trying out PDFsharp 6.0.0-Preview-4?
Or take the v1.50 source code, remove the check, and compile your own DLLs.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

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