Avec ce code, je reçois toujours le même numéro de page sur chaque page. Comment résoudre ce problème?Toujours le même numéro de page dans MigraDoc
static void DefineContentSection(Document document)
{
Section section = document.AddSection();
section.PageSetup.OddAndEvenPagesHeaderFooter = true;
section.PageSetup.StartingNumber = 1;
Paragraph paragraph = new Paragraph();
paragraph.AddText("Page ");
paragraph.AddPageField();
paragraph.AddText(" of ");
paragraph.AddNumPagesField();
section.Footers.Primary.Add(paragraph);
section.Footers.EvenPage.Add(paragraph.Clone());
}