Hi,
I am using aspose.pdf for creating PDF documents. I need to merger two PDF files. Issue is the merged file (second one) is restarting page numbers. For example.
1st PDF had 3 pages and 2nd PDF had 6 pages so merged PDF is showing like 1-3 and then 1-6. I want it to show like 1-9.
I tried. PDF.pages.ADD() for adding both PDF to new PDF.
Also tried pdfDocument1.getPages().add(pdfDocument2.getPages()); but did not work.
Please help!
1 Like
@GAURI02X
Could you please share your sample PDF documents with us. We will test the scenario in our environment and address it accordingly.
Hi Asad, Please find attached PDFs.Sample2.pdf (101.7 KB)
Sample1.pdf (86.2 KB)
@GAURI02X
Thanks for sharing sample files.
We have tested the scenario in our environment and observed the page number sequence issue. Please note that page numbers are added at the time of PDF generation and once PDF document is saved, they become part of content. In other words, they cannot be detected as separate entity or resource but as text. It is highly unlike that page numbers can be manipulated unless they were added as stamp or annotation.
Nevertheless, we have logged an investigation ticket as PDFNET-46110 in our issue tracking system for the sake of detailed investigation. As soon as we have some definite updates regarding its resolution, we will surely inform you. Please be patient and spare us little time.
Hi Asad, I understand that the the page number PRINTED on the page is already part of the pdf and cannot be manipulated. But it seems that even how the pdf reader reads the pdf doesn’t seem correct. As you can see in my attached picture, I merged two same pdf files, each with 448 pages, and it becomes one pdf with 896 pages. It is the 3rd page in the second pdf, yet the pdf reader still reads it as the 3 page.
Screenshot 2026-02-02 100904.png (14.9 KB)
@stonechen28
Thanks for providing above information. We have updated the ticket information accordingly will perform investigation from this perspective as well. We will inform you once we have some updates about ticket resolution. We apologize for the inconvenience caused.