PDFsharp: Is there a way to generate “Page X of Y” in the header of the page?
Make sure to include the using MigraDoc.DocumentObjectModel; statement in your class. Document document = new Document(); Section section = document.AddSection(); Paragraph paragraph = new Paragraph(); paragraph.AddText(“Page “); paragraph.AddPageField(); paragraph.AddText(” of “); paragraph.AddNumPagesField(); section.Headers.Primary.Add(paragraph);