Hello,
We’re trying to add header & footer to the PDF but when we check the same with the Acrobat Reader it’s not able to find any header & footer. I’m attaching the PDF here and screen shot from the Acrobat Reader as well. image.png (100.8 KB) firstpage.pdf (90.7 KB)
Code we used to add header & footer is as below:
//add header and footer
Aspose.Pdf.HtmlFragment headerFragment = new Aspose.Pdf.HtmlFragment(headerHTMLString);
Aspose.Pdf.HtmlFragment footerFragment = new Aspose.Pdf.HtmlFragment(footerHTMLString);
for (int k = 0; k < docLastPage.Pages.Count; k++)
{
Aspose.Pdf.HeaderFooter pdfHeader = new Aspose.Pdf.HeaderFooter();
pdfHeader.Paragraphs.Add(headerFragment);
pdfHeader.Margin = new MarginInfo(30, 0, 30, 0);
docLastPage.Pages[k + 1].Header = pdfHeader;
Aspose.Pdf.HeaderFooter pdfFooter = new Aspose.Pdf.HeaderFooter();
pdfFooter.Paragraphs.Add(footerFragment);
//pdfFooter.Margin = new MarginInfo(20, 0, 20, 710);
pdfFooter.Margin = new MarginInfo(20, 0, 20, 0);
docLastPage.Pages[k + 1].Footer = pdfFooter;
}
Regards,
Synoptek