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

Is it possible to add different header and footer when table flow to more pages?


It can possible by creating two different documents. One document with table alone and another document with different header and footer now overlay the header footer document with the table document.


PdfLoadedDocument ldDoc2 = new PdfLoadedDocument(@''..\..\headerfooter.pdf'');

PdfLoadedDocument ldDoc1 = new PdfLoadedDocument(@''..\..\table.pdf'');

PdfDocument doc = new PdfDocument();

 for (int i = 0, count = ldDoc2.Pages.Count; i < count; ++i)


PdfPage page = doc.Pages.Add();

page.Section.PageSettings.Margins.All = 0;

PdfGraphics g = page.Graphics;

 PdfPageBase lpage = ldDoc2.Pages[i];

PdfTemplate template = lpage.CreateTemplate();

 g.DrawPdfTemplate(template, PointF.Empty, page.GetClientSize());

 lpage = ldDoc1.Pages[0];

template = lpage.CreateTemplate();

 g.DrawPdfTemplate(template, PointF.Empty, page.GetClientSize());



Dim ldDoc2 As PdfLoadedDocument = New PdfLoadedDocument( ''..\..\headerfooter.pdf'');

Dim ldDoc1 As PdfLoadedDocument = New PdfLoadedDocument( ''..\..\table.pdf'');

Dim doc As PdfDocument = New PdfDocument()

Dim i As Integer = 0

Dim count As Integer = ldDoc2.Pages.Count

Do While i < count

Dim page As PdfPage = doc.Pages.Add()

page.Section.PageSettings.Margins.All = 0

Dim g As PdfGraphics = page.Graphics

Dim lpage As PdfPageBase = ldDoc2.Pages(i)

Dim template As PdfTemplate = lpage.CreateTemplate()

g.DrawPdfTemplate(template, PointF.Empty, page.GetClientSize())

lpage = ldDoc1.Pages(0)

template = lpage.CreateTemplate()

g.DrawPdfTemplate(template, PointF.Empty, page.GetClientSize())

i += 1




Article ID: Published Date: Last Revised Date: Platform: Control:
908 04/30/2011 07/10/2014 WinForms PDF
Did you find this information helpful?
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