Page number and headers are not working

Dim header As New HeaderFooter(builder.Document, HeaderFooterType.HeaderPrimary)
Dim footer As New HeaderFooter(builder.Document, HeaderFooterType.FooterPrimary)
footer.AppendParagraph("PAGE | ")
Dim para As Paragraph = footer.FirstParagraph


Thanks for your inquiry. Please call Document.UpdateFields method before saving the document. Hope this helps you.

If you still face problem, please share the problematic and expected output document here for our reference. We will then provide you more information about your query.

Capture2.JPG (28.9 KB)
Capture1.JPG (72.5 KB)

        doc.Save(Server.MapPath(“~”) + "Report\Report.docx")

page number and header is visible only in first page.Capture3.JPG (59.7 KB)

Perhaps you are using PageSetup.DifferentFirstPageHeaderFooter property or inserting the page field only in first section of document. If you are inserting the page field only in first section of document, you can link the headers and footers of sections to first section. Please use HeaderFooterCollection.LinkToPrevious method.

If you still face problem, please ZIP and attach your input Word, HTML and output document that shows the undesired behavior. Please also share the code example to reproduce this issue at our end. Thanks for your cooperation.