PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Jul 19, 2024 1:18 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Error when opening pdf
PostPosted: Wed Feb 22, 2012 10:13 am 
Offline

Joined: Wed Feb 22, 2012 9:47 am
Posts: 2
Hi

I have built an application using pdfsharp.dll (1.31.1789.0). The application combines several existing single pdf pages into a new pdf and then includes bookmarks to this new pdf. When the application runs on my and most other computer systems everything works fine (great tool!!). Unfortunately one user noticed problems when using the software: When opening the pdf files he produced on his system Adobe Reader says "There was an error processing a page. There was a problem reading this document (110)".
I performed a byte comparison of a sample file produced on my system resp. produced on the clients system and noticed slight differences:
Besides the "/CreationDate" and and ID almost at the end of the document there are (on the 8 page pdf file) 8 times the same following differences:

Working file: "/K -1"
Corrupt file: "/K _1"

The context within the pdf file where this can be found is the following:

...
/DecodeParms
<<
/K -1
/Columnms 2320
>>
/Length...
...

Is this difference the reason why Adobe can't read the pdf file?
How can the problem be solved?

Thanks a lot with kind regards!


Top
 Profile  
Reply with quote  
PostPosted: Wed Feb 22, 2012 12:30 pm 
Offline
PDFsharp Guru
User avatar

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

Looks like a bug in PDFsharp.

I presume the user changed the Negative Number Symbol from "-" to "_". But this UI change should have no effect on the generated PDF files, but it does.

After "/K" a PdfInteger will be written, so I presume a change in PdfWriter will fix it:
Code:
public void Write(PdfInteger value)
{
  WriteSeparator(CharCat.Character);
  this.lastCat = CharCat.Character;
  WriteRaw(value.Value.ToString(CultureInfo.InvariantCulture));
}


But there are many other "value.ToString()" that should be changed to "value.ToString(CultureInfo.InvariantCulture)" to make PDF generation independent of user settings.

We'll fix this with PDFsharp 1.32 (coming out this week or next week or so).

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Feb 22, 2012 1:22 pm 
Offline

Joined: Wed Feb 22, 2012 9:47 am
Posts: 2
Thanks a lot for this quick reply and helpful hint!


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

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 55 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