Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

[Urgent] Different footer section for multiple page document

$
0
0

I need to generate different set of footer in my multi page pdf document which is generated using Aspose.Pdf.Generator

I am dynamically generating the pdf and the data I am adding to the section is spannign across multiple pages.

I need a separate footer for the last page only and separate footer for the rest of the pages, starting from the first page to the last-1 page.

 

Here is the code snippet I am using to generate the footer:

Sections

sections = request.Pdf.Sections;

int secCount = sections.Count;

Section sec1 = request.Pdf.Sections[sections.Count - 1];

sec1.SetPageSettings();

// Create a Footer Section of the document

Aspose.Pdf.Generator.

HeaderFooter footer1 = new Aspose.Pdf.Generator.HeaderFooter(sec1);

footer1.IsLastPageOnly =

false;

// set the Odd footer of the PDF file

sec1.OddFooter = footer1;

// set the Even footer of the PDF file

sec1.EvenFooter = footer1;

// Footer content display

FooterContentForAllPages(footer1);

Aspose.Pdf.Generator.

HeaderFooter footer2 = new Aspose.Pdf.Generator.HeaderFooter(sec1);

// set the Odd footer of the PDF file

sec1.AdditionalOddFooter = footer2;

// set the Even footer of the PDF file

sec1.AdditionalEvenFooter = footer2;

footer2.IsLastPageOnly =

true;

// Footer content display

FooterContentForLastPage(footer2);

When we generate more than one page document using this, footer1 is getting displayed in all the pages. althought footer2 is getting displayed only in the last page. I want to display footer1 on all pages except the last page.

Please provide a solution for this.

Thanks,

Saikat

 


Viewing all articles
Browse latest Browse all 3131

Latest Images

Trending Articles



Latest Images