Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Margin in MigraDoc

I'm using MigraDoc and PDFsharp and I need to set different margins for each page in my PDF document. Using

  document.DefaultPageSetup.RightMargin = 20;
  document.DefaultPageSetup.LeftMargin = 20;

I obtain that all the pages in my document will have the same margins. How can I set the margins for each page in my document? Thank you

like image 852
Martina Avatar asked Oct 13 '14 09:10

Martina


1 Answers

You should never modify DefaultPageSetup.

You can create several sections in your document. You can set the PageSetup for each section as needed.

All pages in a section will have the same page size (PageSetup). I presume you only have a single section and thus you change all pages.

like image 117
I liked the old Stack Overflow Avatar answered Sep 18 '22 10:09

I liked the old Stack Overflow