PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Nov 10, 2024 7:42 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
PostPosted: Mon Jun 09, 2008 6:42 pm 
Offline

Joined: Mon Jun 09, 2008 5:36 pm
Posts: 2
Location: Ukraine
Hello everybody!

I have found bug when I try to import pages with specific image to the new PDF document. For reproduce it you should to download document by the follow link:

http://ostap.org.ua/bug.pdf

and execute folow code:

Code:
string srcDocPath = ...; // path to the downloaded document;
string dstDocPath = ...; // path to the output document;

using (PdfDocument dstDoc = new PdfDocument(dstDocPath))
  try
  {
    PdfPage page;
    using (XPdfForm srcDoc = XPdfForm.FromFile(srcDocPath))
      for (srcDoc.PageNumber = 1; srcDoc.PageNumber <= srcDoc.PageCount; srcDoc.PageNumber++)
      {
        page = dstDoc.AddPage();
        using (XGraphics gfx = XGraphics.FromPdfPage(page))
        {
          gfx.DrawImage(srcDoc, new XRect(0, 0, (double)srcDoc.Page.Width, (double)srcDoc.Page.Height));
        }
        page.Close();
      }
  }
  finally
  {
    dstDoc.Close();
  }


After execution we will have result document with corrupted image.

Best Regards,
Artem


Last edited by PapaCarlo on Tue Jun 10, 2008 12:13 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jun 10, 2008 8:52 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3111
Location: Cologne, Germany
Hello!

I cannot download the PDF file.
Maybe there's something wrong with the link.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jun 10, 2008 12:12 pm 
Offline

Joined: Mon Jun 09, 2008 5:36 pm
Posts: 2
Location: Ukraine
Please try from there: http://ostap.org.ua/bug.pdf


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jun 10, 2008 12:41 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3111
Location: Cologne, Germany
Hello!

I tested your file and your code with the current internal build of PDFsharp - and it worked without problem.

I hope you can wait a few days until PDFsharp 1.2 comes out.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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: No registered users and 5 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:  
cron
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group