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