PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Mar 29, 2024 6:40 am

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
PostPosted: Wed Apr 20, 2016 3:09 pm 
Offline

Joined: Wed Apr 20, 2016 2:56 pm
Posts: 2
Hello

I'm trying to load the attached PDF as an XPdfForm to render some of its contents into another PDF. The PDF itself has been generated by PDFSharp.

The exception I'm getting is at line 250 of PdfSharp.SharpZipLib.Zip.Compression.Inflater.cs :

Code:
      if (header % 31 != 0)
      {
        throw new SharpZipBaseException("Header checksum illegal");
      }


I'm trying to load it like this:

Code:
            var filepath = "C:\\test3.pdf";
            pdfForm = XPdfForm.FromFile(filepath);
            gfx.DrawImage(pdfForm, new XPoint());


I didn't manage to attach the file (the website keeps telling me that the "image" I uploaded was invalid), so here it can be downloaded:

https://dl.dropboxusercontent.com/u/35614983/test3.pdf

Is there an explanation for this exception, or is it a bug in PDFSharp or SharpZipLib?

Thank you very much!
Best regards!


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 20, 2016 3:28 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
Hi!
lcc wrote:
The PDF itself has been generated by PDFSharp.
That's what it says.
Did you create it? Or did you get it from someone else?

Looks as if the PDF was processed by a different tool.
Maybe the password protection causes this problem.

Re attachments:
viewtopic.php?f=2&t=832

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 20, 2016 5:18 pm 
Offline

Joined: Wed Apr 20, 2016 2:56 pm
Posts: 2
Oh, right. Turns out we're using cpdf.exe at some point to encrypt the documents.

Problem solved. Thank you!


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: No registered users and 175 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