View previous topic :: View next topic |
Author |
Message |
PapaCarlo
Joined: 09 Jun 2008 Posts: 2 Location: Ukraine
|
Posted: Mon Jun 09, 2008 6:42 pm Post subject: Problem with image (GIF) importing |
|
|
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 |
|
Back to top |
|
|
Thomas Hoevel
Joined: 16 Oct 2006 Posts: 387 Location: Cologne, Germany
|
Posted: Tue Jun 10, 2008 8:52 am Post subject: |
|
|
Hello!
I cannot download the PDF file.
Maybe there's something wrong with the link. _________________ Regards
Thomas Hoevel
PDFsharp Team |
|
Back to top |
|
|
PapaCarlo
Joined: 09 Jun 2008 Posts: 2 Location: Ukraine
|
|
Back to top |
|
|
Thomas Hoevel
Joined: 16 Oct 2006 Posts: 387 Location: Cologne, Germany
|
Posted: Tue Jun 10, 2008 12:41 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
|