I am converting the HTML content into PDF using pdfConverter in .Net. So I wanted to add a Footer for every page as in my PDF I have multiple questions with answers, so there can be 3-4 pages and every page should have the same footer. How can I achieve this?
Footer in pdfConverter
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Jayraj ChhayaRank #304 · 8.2K reputationPosted Feb 26, 2024, 6:56 AM EST
To add a footer to every page in the PDF generated using pdfConverter in .Net, you can utilize the
PdfConverter.PdfDocumentOptionsclass.Here's a sample code snippet to achieve this:
PdfConverter pdfConverter = new PdfConverter(); pdfConverter.PdfDocumentOptions.ShowFooter = true; pdfConverter.PdfDocumentOptions.Footer.Text = "Your Footer Text Here"; pdfConverter.PdfDocumentOptions.Footer.FontSize = 10; pdfConverter.PdfDocumentOptions.Footer.TextAlign = PdfTextAlign.Center; // Add any other footer customization as needed // Perform the HTML to PDF conversion pdfConverter.SavePdfFromHtmlStringToFile("YourHTMLContent", "YourPDFOutputPath");By setting the
ShowFooterproperty totrueand customizing the footer text, font size, alignment, and other properties withinPdfDocumentOptions, you can ensure that every page in the PDF includes the specified footer content.Madhu PatelRank #663 · 3.6K reputationPosted Feb 27, 2024, 12:28 AM EST
I did the same in my code and now I am getting this:-
'PdfDocumentOptions ' does not contain a definition for 'Footer'