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);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)