PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.com/

There's a problem with drawing "XPdfForm" with "DrawImage"
http://forum.pdfsharp.com/viewtopic.php?f=3&t=3946
Page 1 of 1

Author:  lee [ Tue Apr 23, 2019 9:26 am ]
Post subject:  There's a problem with drawing "XPdfForm" with "DrawImage"

This is my code:
Code:
        private void Test(string src, string dst)
        {
            PdfDocument outputDocument = new PdfDocument();
            outputDocument.PageLayout = PdfPageLayout.SinglePage;
            XPdfForm form = XPdfForm.FromFile(src);
            for (form.PageIndex = 0; form.PageIndex < form.PageCount; form.PageIndex++)
            {
                PdfPage page = outputDocument.AddPage();
                page.Orientation = PageOrientation.Portrait;
                page.Width = form.Page.Width;
                page.Height = form.Page.Height;

                //DrawInfo(page, form.PageCount, form.PageNumber);

                using (var gfx = XGraphics.FromPdfPage(page))
                {
                    gfx.DrawImage(form, 0, 0);
                }
            }
            outputDocument.Save(dst);
        }


When the original PDF file is generated by Illustrator CS6 and there are hidden layers, pdfsharp draws the contents of hidden layers together.
Attachments can't upload PDF, so I uploaded screenshots.
-------------------------------------------------------------
Attachment:
image.png
image.png [ 8.8 KiB | Viewed 75 times ]

-------------------------------------------------------------
This is the PDF file´╝Ühttp://www.ul.to/4jqlpdjg

Author:  Thomas Hoevel [ Tue Apr 23, 2019 11:34 am ]
Post subject:  Re: There's a problem with drawing "XPdfForm" with "DrawImag

lee wrote:
Attachments can't upload PDF, so I uploaded screenshots.
Zipped PDFs can be uploaded. Screenshots don't have to be zipped.
http://forum.pdfsharp.net/viewtopic.php?f=2&t=832

Author:  lee [ Fri Apr 26, 2019 6:40 am ]
Post subject:  Re: There's a problem with drawing "XPdfForm" with "DrawImag

Thomas Hoevel wrote:
lee wrote:
Attachments can't upload PDF, so I uploaded screenshots.
Zipped PDFs can be uploaded. Screenshots don't have to be zipped.
http://forum.pdfsharp.net/viewtopic.php?f=2&t=832


I uploaded the PDF file

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/