Margin at MigraDoc

I use MigraDoc and PDFsharp, and I need to set different fields for each page in my PDF document. Using

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

I get that all pages in my document will have the same fields. How to set margins for each page in a document? Thanks you

+4
source share
1 answer

You should not change the DefaultPageSetup.

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

All pages in the section will have the same page size (PageSetup). I assume that you have only one section, and therefore you are changing all pages.

+8
source

All Articles