Aspose-Pdf-9.3.0 for Java
Using the following code taken from your example:
com.aspose.pdf.Document pdfDocument1 = new com.aspose.pdf.Document(myDir + "someDoc1.pdf");
com.aspose.pdf.Document pdfDocument2 = new com.aspose.pdf.Document(myDir + "someDoc2.pdf");
com.aspose.pdf.Document pdfDocument3 = new com.aspose.pdf.Document();
pdfDocument3.getPages().add(pdfDocument1.getPages());
pdfDocument3.getPages().add(pdfDocument2.getPages());
pdfDocument3.save(myDir + "Merged.pdf");
pdfDocument3.dispose();
I can successfully merge the contents of two Static PDFs containing Forms, but this does not work as soon as you try to use a PDF that includes a Dynamic Form. If using a Dynamic form and trying to view the merged PDF in Adobe Reader, you will only ever see this message: "If this message is not eventually replaced by the proper contents of the document, your PDF viewer may not be able to display this type of document."
Is this just a limitation of the toolkit? Should I be / is there a way to convert the Dynamic PDFs to a Static representation before I attempt this merge? I am attaching a sample Dynamic PDF for reference. Thank You.