Set margin while adding pdf file into existing PDF file

Hello support,

I have created one Invoice using HTML to PDF and it’s working as per the expecttion. Now in have 3 to 4 pdf file which in wanted to merge into invoice pdf which is generated using aspose.pdf.

i want to set margin in such a way so that additional PDF displayed in center of the page. can you please guide us for the same?

MergePDFCode.docx (13.5 KB)

I have attached code that we are using for merge the pdf file.


While merging the PDF documents, the original dimensions and properties of the pages will remain intact. Margins and dimensions of PDF pages can be set at the time of PDF generation. Changing dimensions of existing PDF page can be quite complex and return unexpected results.

Instead of merging the PDF documents, we request you please use PdfPageStamp class which allows you to specify desired height/width. You can create new pages in your PDF invoice and then add pages from other PDF files using PdfPageStamp. In case you face any issues, please share your sample files with us. We will test the scenario in our environment and address it accordingly.

We have checked from our end. but facing same issue. Can you please assist further on the same?

Please suggest if there are any alternative solution for the same?

Thanks in advance.


Would you please share which code snippet you tried along with the sample files that you have used? We will test the scenario in our environment and address it accordingly.

Hello Support,

We have shared demo attached here with. Please note that we need to remove hignlighted space at upper top part of image which is mentioned(Screenshot_described.png). Sample merged image is also there in attachment (Invoice_1.pdf)

MergePDF DEMO (1.2 MB)

Please let us know in case of any additional information required.



We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-56528

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.