Individual page numbering in sections

Hi,
I’m wondering if it is possible to get individual page numbering for each section?
So when a new section begins the page number restarts at 1.

Hi
Thanks for your inquiry. I think that you can try using RestartPageNumbering. See the following code for example.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Set start number
builder.PageSetup.PageStartingNumber = 1;
// Page numbers will be restarted for each section
builder.PageSetup.RestartPageNumbering = true;
// Insert PAGE fiel into the header
builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary);
builder.InsertField("PAGE", string.Empty);
builder.MoveToDocumentEnd();
// Insert page break
builder.InsertBreak(BreakType.PageBreak);
// Insert section break
builder.InsertBreak(BreakType.SectionBreakNewPage);
doc.Save(@"Test077\out.doc");

Hope this helps.
Best regards.

A post was merged into an existing topic: Individual page numbers for different sections