Free Support Forum - aspose.com

Repaginate after PdfFileEditor.concatenate()

I have concatenated separate PDFs using PdfFileEditor.concatenate()... how can I reapply the page numbers to the entire document?

Hi Arjun,


I would like to share with you that we have introduced merged Aspose.Pdf for.NET, which allows you to add page numbers in two different ways: either you can use the legacy approach to add page numbers or add the page numbers using new DOM API.

However, as you say you want to reapply the page numbers, it looks like you want to remove the existing page numbers and then add new page numbers from the start of the page. Am I correct? If so, please share your requirement in a little more detail, so we could better understand it and then guide you accordingly.

We’re looking forward to help you out.
Regards,

Thanks for the quick response. I am using a licensed version of Aspose PDF, PDF.Kit, and Cells for Java.

The code I am using is

PdfFileEditor pdfFileEditor.concatenate(inStreams, outputStream);

to merge already existing PDFs, all of which have already been individually numbered. They have been numbered in the footers, with code in an upstream application like the following:

="Page " & FormatNumber (Page() , “#”) & " of " & FormatNumber (NumberOfPages() , “#”)

I would like to use the Apose PDF or PDF.Kit to remove the existing page numbers, which have been applied using the above, and apply my own numbering to the entire set of merged documents in my Java application.

Thanks

Hi Arjun,

Thank you very much for sharing further details. I’m afraid, this feature is currently not supported. However, I have logged a new feature request as PDFKITJAVA-28947 in our issue tracking system. You’ll be updated via this forum thread once it is supported.

We’re sorry for the inconvenience.
Regards,

Thanks for the info. If the requirement to remove existing page numbers is removed, what is the easiest way to add my own page numbers to the merged PDF using the Apose API? Either PDF or PDF.Kit

THanks

Hi Arjun,

You may use addPageNumber method of the PdfFileStamp class to add page number in a PDF file. You can find all the overloads of this method on PdfFileStamp class page.

I hope this helps. If you find any further questions, please do let us know.
Regards,