We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Page settings changes when importing another PDF document

Thread ID:





105369 Oct 5,2012 09:23 AM UTC Oct 8,2012 03:49 AM UTC WPF 1
Tags: PDF
Svein Erik Hopen
Asked On October 5, 2012 09:23 AM UTC

I am building a report using the PDF library (

For each page in my report, I am importing another PDF document. This works fine, except that I am losing the margins when I am importing from the other document.

My code is like this

PdfDocument document = new PdfDocument();

PdfPage firstPage = document.Pages.AddPage();
// Do something with this page...works fine...

PdfLoadedDocument loadedDocument = new PdfLoadedDocument(fileName);

// Another document is appended...works fine

PdfPage nextPage = document.Pages.AddPage();
// Do something with this page...works almost fine, but this page appears with no margins


Appreciate your help.

Best regards
Svein Erik

Geetha M [Syncfusion]
Replied On October 8, 2012 03:49 AM UTC

Hi Svein,

Thank you for your interest in Syncfusion products.

I was able to see that the page appears without margin. This is because, while importing the document, the margins are set to 0. To solve it, please add a new section before creating a page. This will retain the margin. Following is the code snippet:

PdfSection section = document.Sections.Add();

PdfPage page = document.Pages.Add();

Please try this and let us know if you have any questions.




This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon