PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Jul 04, 2024 6:28 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: Corrupt PDF after Merge
PostPosted: Mon Jan 28, 2013 8:51 am 
Offline

Joined: Mon Jan 28, 2013 8:30 am
Posts: 1
Hello,

we use pdfsharp to create pdf documents. Up to that point everything is okay. In a second step we merge these documents to multiple bigger pdfs. We do it as descriped at http://www.pdfsharp.net/wiki/CombineDocuments-sample.ashx. But sometimes in one file a few pages (1-3) get corrupted and we can't print that pdf file with Acrobat Reader. With the Foxit Reader we can open and print that pdf.

I want to ask if thats a known problem and/or somebody knows a workaround?

Before somebody asks, i can't submit the faulty pdf because it's full of personal data. :cry:

Cheers,
Pascal


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 28, 2013 9:41 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Hi!
Pascal Ziener wrote:
Before somebody asks, i can't submit the faulty pdf because it's full of personal data. :cry:
Any chance to replicate the problem with anonymized or synthetized data?

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Tue May 14, 2013 11:01 pm 
Offline

Joined: Tue May 14, 2013 10:30 pm
Posts: 1
We have the same problem with several difference cases. One of the case is that we combine 143 pdf files and we got 1 corrupted page. Then we look into that individual pdf and that is fine, no corrupted page. When we import that pdf only, the combined pdf (1 pdf) works fine. When we combine 3 pdfs, it works too.

Having said that, I notice that there is a message displayed in the visual studio output

"PrepareForSave: Number of deleted unreachable objects: 3"

After I commented out the following code in PdfDocument.cs, no corrupted page in the combined pdf.

//int removed = this.irefTable.Compact();
//if (removed != 0)
//Debug.WriteLine("PrepareForSave: Number of deleted unreachable objects: " + removed);

I don't know whether this is the right thing to do, that is why I need your help.


Top
 Profile  
Reply with quote  
PostPosted: Thu May 16, 2013 1:16 pm 
Offline
empira Employee
User avatar

Joined: Thu Oct 12, 2006 10:07 pm
Posts: 49
Location: Cologne, Germany
I found this bug very recently. Remove the following superfluous lines in function TransitiveClosureImplementation in class PdfReferenceTable (file PdfReferenceTable.cs)

//if (depth-- == 0)
// return;

Very stupid bug – sorry for that.


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: Bing [Bot], Google [Bot] and 139 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