PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Copy settings from Pdf (PdfDocument)
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2588
Page 1 of 1

Author:  MemmeR [ Mon Sep 30, 2013 12:30 pm ]
Post subject:  Copy settings from Pdf (PdfDocument)

I have a PdfDocument (InputDocument) which I opened with PdfReader.Open, I want to take a certain page from this document and apply it to some other PdfDocument (OutputDocument).

The problem that the images on OutputDocument gets what looks like their brightness increased and doesn't look like the original InputDocument.

Can I copy the settings from InputDocument and apply it to OutputDocument or can I somehow make sure the images look the same?

Code:
                    // Create and read a input document
                    // targetFileInfo is a FileInfo object
                    PdfDocument InputDocument = PdfReader.Open(targetFileInfo.FullName, PdfDocumentOpenMode.Modify);

                    PdfDocument OutputDocument = new PdfDocument();

                    // Get page 0 from InputDocument and save it
                    OutputDocument.Pages.Add(InputDocument.Pages[0]);
                    OutputDocument.Save(@"C:\TestPdf.pdf");

I added two images which shows the difference between the two.

Attachments:
InputDocumentImage.jpg
InputDocumentImage.jpg [ 215.59 KiB | Viewed 4228 times ]
OutputDocumentImage.jpg
OutputDocumentImage.jpg [ 218.19 KiB | Viewed 4228 times ]

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