We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to add different header and footer in different pages in a PDF Document

How to add different header and footer in different pages of a PDF Document

It is possible to add different Header and Footer in different pages of a PDF document. To achieve this, multiple sections has to be created using the PdfSection class and the header and footer can be added separately in each section.

The code snippets given below explains how to create multiple sections in a PDF document and add header and footers to it.


            //Creating section1 and adding pages to them

            PdfSection section1 = doc.Sections.Add();




            //Creating section2 and adding pages to them

            PdfSection section2 = doc.Sections.Add();




            //Including header and footer to the 1st section

            section1.Template.Top = AddHeader(doc, "Header 1");

            section1.Template.Bottom = AddFooter(doc, "Footer 1");


            //Including header and footer to the 2nd section

            section2.Template.Top = AddHeader(doc, "Header 2");

            section2.Template.Bottom = AddFooter(doc, "Footer 2");



Please find the working sample in the below link location.


Article ID: Published Date: Last Revised Date: Platform: Control:
2689 11/18/2014 11/18/2014 WinForms PDF
Did you find this information helpful?
Adrian Grigore Nov 06, 2018

This workaround does not work if the content of the document spans several pages (i.e. a PDFGrid that is several pages long).

KarthikeyanC [Syncfusion] Nov 08, 2018

@Adrian Grigore - Please find the sample to meet your requirement.


Add Comment
You must log in to leave a comment

Please sign in to access our KB

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon