PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 6:16 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: Tue Apr 23, 2019 9:26 am 
Offline

Joined: Thu Mar 07, 2019 1:24 am
Posts: 7
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 10176 times ]

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


Last edited by lee on Fri Apr 26, 2019 6:39 am, edited 3 times in total.

Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 23, 2019 11:34 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
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

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Fri Apr 26, 2019 6:40 am 
Offline

Joined: Thu Mar 07, 2019 1:24 am
Posts: 7
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


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 08, 2023 8:04 am 
Offline

Joined: Fri Sep 08, 2023 7:29 am
Posts: 1
Hi Team

Are the problem had been solved? I face the same problem in my project, and I want to know if that PDFSharp1.50.* had provided any OCG methods to edit the PDF layers. or may be can detect if PDF has the hide layer at least.

Thank you.


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 48 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