Have Footer on all except last page

I’m creating an invoice with the Aspose.PDF application. I need the totals to display on the last page, but on every other page for it to display “Continued on Next Page”.

Is there an easy way to have an equivalent of IsSubsequentPagesOnly for the last page? Something like IsPrecedingPagesOnly which would print on every page except if the page is the last one.

Thanks for any help!

- Peter

Hi,

Thank you for considering Aspose.

Thanks for the suggestion, I will discuss the possibilities with the developers and will let you know about that. Meanwhile, can’t you use page numbering like page Of TotalPages. For e.g in the footer it display like “page 2 of 25” so it can also make the user understand that still some pages are left. If you think that is also acceptable then please refer to:

http://www.aspose.com/Wiki/default.aspx/Aspose.Pdf/SymbolsUsage.html

Thanks.

Adeel Ahmad
Support Developer
Aspose Changsha Team

Currently our system has the T&C’s as part of the page numbering system.

I’m pretty much assuming it should be ok. It’s more of a “nice to have” thing than anything else :slight_smile: It would only really be useful on invoices.

Thank you for the response!

Dear Peter,

I have logged this issue and we will try to support this feature in the future version. As a workaround, you can add a white rectangle to overlap the footer for the last page. Please refer to the following xml:



Continued on Next Page
page 1
page 2
page 3





I have the same request/issue.


any update ?

Hi Ken,

Thanks for your inquiry. You can easily set different headers/footer for any page using Aspose.Pdf. Please check the following code snippet for the purpose. It will help you to accomplish the task.

// Load an existing PDF file
Document doc = new Document("input.pdf");

Aspose.Pdf.HeaderFooter footer = new Aspose.Pdf.HeaderFooter();
Aspose.Pdf.HeaderFooter footer1 = new Aspose.Pdf.HeaderFooter();

//Add footer text
Aspose.Pdf.Text.TextFragment fTxt = new Aspose.Pdf.Text.TextFragment("$p / $P");
fTxt.TextState.Font = FontRepository.FindFont("Arial");
fTxt.TextState.FontSize = 16;
fTxt.HorizontalAlignment = Aspose.Pdf.HorizontalAlignment.Right;
footer.Paragraphs.Add(fTxt);

//Add footer text
Aspose.Pdf.Text.TextFragment fTxt1 = new Aspose.Pdf.Text.TextFragment("Continued on Next Page");
fTxt1.TextState.Font = FontRepository.FindFont("Arial");
fTxt1.TextState.FontSize = 16;
fTxt1.HorizontalAlignment = Aspose.Pdf.HorizontalAlignment.Right;
footer1.Paragraphs.Add(fTxt1);

for (int cnt = 1; cnt <= doc.Pages.Count; cnt++)
{
    if (cnt < doc.Pages.Count)
        doc.Pages[cnt].Footer = footer1;
    else
        doc.Pages[cnt].Footer = footer;
}

doc.Save("Outputfooter.pdf");

Please feel free to contact us for any further assistance.

Best Regards,

Hi Tilal, thanks for your quick response!!


currently I am using Aspose.pdf.generator with predefined XML template.
and fill in text/table cell in runtime by code.

here is the example footer tag.

- TO BE CONTINUED -
is there any way to do it by predefined XML template?

thanks.

Ken

Hi Ken,


Thanks for your feedback. I am afraid the requested feature is still not implemented in Aspose.Pdf XML schema. However we have linked your post to the enhancement request PDFNEWNET-38328. We will notify you as soon as it is resolved.

We are sorry for the inconvenience caused.

Best Regards,