Concatenate multiple Pdf documents by removing extra space at end of document

The requirement is,
1. Concatenate multiple Pdf files by removing unnecessary space at the end of each document
2. Add line separator or no.of blank lines at the end of each pdf document

I tried multiple ways to concatenate documents but none will allow to remove extra spaces.

1) pdfDocument1.Pages.Add(pdfDocument2.Pages);

2) pdfEditor.Concatenate("input1.pdf", "input2.pdf", "output.pdf");

3) pdfEditor.Concatenate(inputStream1, inputStream2, outputStream);

4) As work around i tried two ways,
1. Converting Pdf to Rtf, combine documents with line separator then convert back to Pdf. But its not able to process images and tables.

2. Converting to Html then back to Pdf. This is able to process images but when it comes to table, text is not displayed within table cells.

I'm using Aspose.Pdf.dll 7.1.0.0

Please suggest right way to achieve the requirement.

Hi Vattem,


Thanks for your inquiry. I am afraid currently Aspose.Pdf does not support the concatenation right after the last page text of first document. We have already logged a feature request PDFNEWNET-36081 for same in our issue tracking system. I have linked your post to the request id and we will notify you as soon as it is implemented.

Moreover, you may try latest release of Aspose.Pdf for .NET for your workaround as it has many fixes and enhancements as compare to 7.1.0.0.

We are sorry for the inconvenience caused.

Best Regards,