Category / Section
How to add Header and Footer in an existing PDF document(PdfLoadedDocument)?
2 mins read
For adding Header and Footer in an existing PDF document, you can import the PdfLoadedDocument to PdfDocument and add the Header and Footer. Refer to the following code example.
C#
//Load the existing PDF document
PdfLoadedDocument document = new PdfLoadedDocument("../../Barcode.pdf");
//Create new Pdf Document instance
PdfDocument doc = new PdfDocument();
//Importing PdfLoadedDocument to PdfDocument
doc.ImportPageRange(document, 0, document.Pages.Count - 1);
//Including header and footer
doc.Template.Top = AddHeader(doc, "Header 1");
doc.Template.Bottom = AddFooter(doc, "Footer 1");
Sample Link:
http://www.syncfusion.com/downloads/support/directtrac/general/HeaderAndFooter-328822493.zip