Using cete Dynamic PDFtool I want to remove the footer template from the first page of the document. How to achieve this?
Page.Elements.Add(tblcontent);
Document.Pages.Add(Page);
Using cete Dynamic PDFtool I want to remove the footer template from the first page of the document. How to achieve this?
Page.Elements.Add(tblcontent);
Document.Pages.Add(Page);
The page class has an ApplyDocumentTemplate property that you can set to false, if you do not want a the template to be applied to a particular page.
Document document = new Document();
Template template = new Template();
// Add elements to template
document.Template = template;
Page page1 = new Page(PageSize.Letter);
// Add elements to page
page1.ApplyDocumentTemplate = false;
// Add additional pages leaving ApplyDocumentTemplate as true
// Save the PDF
document.Draw("output.pdf");
You can also accomplish this by using document sectioning. When a document is broken up into sections, each section can have its own template, or not have a template at all. In this following example, the first section doesn't have a template so the page numbers are not shown for the first two pages, and the second section does so page numbers are shown for the last 3 pages.
Document document = new Document();
// Create a template object and add a page numbering label
Template template = new Template();
template.Elements.Add(new PageNumberingLabel("%%SP%% of %%ST%%", 0, 680, 512, 12, Font.Helvetica, 12, TextAlign.Center));
// Begin the first section
document.Sections.Begin(NumberingStyle.RomanLowerCase);
// Add two pages
document.Pages.Add(new Page()); //Page 1
document.Pages.Add(new Page()); //Page 2
// Begin the second section
document.Sections.Begin(NumberingStyle.Numeric, template);
// Add three pages
document.Pages.Add(new Page()); //Page 3
document.Pages.Add(new Page()); //page 4
document.Pages.Add(new Page()); //page 5
// Save the PDF
document.Draw("output.pdf");
Here is a link to a topic on document sectioning: http://docs.dynamicpdf.com/NET_Help_Library_19_08/Document%20Sectioning.html