Hi Aspose support, I am testing code placing a HTML footer on the pages of a PDF using the Aspose.Pdf.Page.Footer property. It works for the first page in the document however the 2nd page has random characters and subsequent pages don’t have anything. Code is below as well as the source and output files.
//Convert the file to PDF
Aspose.Words.Document wordDoc = new Aspose.Words.Document(incomingFile);
wordDoc.Save(outgoingFile);
//Add in the header
Aspose.Pdf.Document pdfDoc = new Aspose.Pdf.Document(outgoingFile);
Aspose.Pdf.HeaderFooter pdfFooter = new Aspose.Pdf.HeaderFooter();
pdfFooter.Margin = new Aspose.Pdf.MarginInfo
{
Top = 10,
Bottom = 10,
Left = 10,
Right = 10
};
pdfFooter.Paragraphs.Add(new Aspose.Pdf.HtmlFragment("<html>Footer</html>"));
foreach (Aspose.Pdf.Page page in pdfDoc.Pages)
{
page.Footer = pdfFooter;
}
pdfDoc.Save(outgoingFile);
HeaderFooterTestDocument_1.zip (49.8 KB)