We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Concatenating multiple PDF Files

Hi,

Has there been any change in the way multiple PDFs are concatenated into a single one in the recent Aspose PDF libraries? I just updated my library to aspose.pdf-10.6.2.jar and it doesnt seem to be working.

My code below,

PdfFileEditor pdfEditor = new PdfFileEditor();
com.aspose.pdf.Document targetDoc = new com.aspose.pdf.Document();
com.aspose.pdf.Document[] docs = new com.aspose.pdf.Document[frameCounter];

for(int i=0; i<frameCounter; i++)
{
com.aspose.pdf.Document attachmentDoc = new com.aspose.pdf.Document(<>);
docs[i] = attachmentDoc;
}

pdfEditor.concatenate(docs, targetDoc); //concatenate all tiff pdf into the attachment pdf document
targetDoc.save(attachmentDocName);

I was looking at the examples and I found this but only for 2 PDFs.

http://www.aspose.com/docs/display/pdfjava/Concatenate+PDF+Files

Please help.

Thanks,
Wasim

Hi Waseem,

Thanks for your inquiry.

Itsak26:

Has there been any change in the way multiple PDFs are concatenated into a single one in the recent Aspose PDF libraries? I just updated my library to aspose.pdf-10.6.2.jar and it doesnt seem to be working.

My code below,

PdfFileEditor pdfEditor = new PdfFileEditor();
com.aspose.pdf.Document targetDoc = new com.aspose.pdf.Document();
com.aspose.pdf.Document[] docs = new com.aspose.pdf.Document[frameCounter];

for(int i=0; i<frameCounter; i++)
{
com.aspose.pdf.Document attachmentDoc = new com.aspose.pdf.Document(<>);
docs[i] = attachmentDoc;
}

pdfEditor.concatenate(docs, targetDoc); //concatenate all tiff pdf into the attachment pdf document
targetDoc.save(attachmentDocName);

I was looking at the examples and I found this but only for 2 PDFs.

http://www.aspose.com/docs/display/pdfjava/Concatenate+PDF+Files


Please note there is no change in concatenation feature of API. I have tested your shared code with both 10.6.1 and latest release 10.9.0 without any issue. We will appreciate it if you please share some more details about the issue faced, so we will look into it and guide you accordingly.

Itsak26:


I was looking at the examples and I found this but only for 2 PDFs.

http://www.aspose.com/docs/display/pdfjava/Concatenate+PDF+Files


In reference to DOM approach of concatenation, it is not limited to two PDFs. You can concatenate as many as files as you wish and your system resources allow.

com.aspose.pdf.Document targetDoc = new com.aspose.pdf.Document();

com.aspose.pdf.Document[] docs = new com.aspose.pdf.Document[4];

for(int i=0; i<4; i++)

{

com.aspose.pdf.Document attachmentDoc = new com.aspose.pdf.Document(myDir+"HelloWorld.pdf");

docs[i]=attachmentDoc;

}

for(int j=0; j<docs.length; j++)

{

// Add the pages of the source documents to the target document

targetDoc.getPages().add(docs[j].getPages());

}

targetDoc.save(myDir+"merged.pdf");


Please feel free to contact us for any further assistance.


Best Regards,

Hi Tilal,

The issue seems to be with licensing. After updating the library, license gets invalid. I have raised that in the forum and being looked at.
Will try once licensing issue is resolved and let you know the outcome.

Just curious, in which timezone does the Aspose support team work?

Thanks,
Wasim

Hi Wasim,


Thanks for your feedback. Sure, we will update you as soon as your license related ticket is resolved then you can test the scenario and share the results.

Furthermore in reference to timezone, different team members of Aspose works in different time-zones.

Best Regards,
Itsak26:
The issue seems to be with licensing. After updating the library, license gets invalid. I have raised that in the forum and being looked at.
Will try once licensing issue is resolved and let you know the outcome.
Hi Wasim,

Please take your time and we will be waiting for further updates from your side.

Itsak26:
Just curious, in which timezone does the Aspose support team work?
The support team works in different times zones but most of the team is available from 8:00 (Greenwich Meantime + 5) till 23:00 (GMT + 5).