Hi,
Hi Mani,
Thanks for using our products.
I have gone through the problem description and the code snippet that you have shared and as per my observations, you are trying to concatenate input1.pdf file with other PDF files and the resultant PDF is always corrupted. In order to test the scenario, I have used the following code snippet where I have first created the copy of input1.pdf and tried concatenating it with input1.pdf. During my testing with Aspose.Pdf.Kit for Java 4.3.0, I am unable to notice any problem in the resultant document.
[Java]
//read the input file
String inFile1 = "D:/pdftest/mergepdf/input1.pdf";
String inFile2 = "D:/pdftest/mergepdf/input1-
Copy.pdf";
String outFile = "D:/pdftest/mergepdf/Merged_Output.pdf";
FileInputStream inStream1 = new FileInputStream(inFile1);
FileInputStream inStream2 = new FileInputStream(inFile2);
//concatenate two files
FileOutputStream outputStream = new FileOutputStream(outFile);
PdfFileEditor editor = new PdfFileEditor();
editor.concatenate(inStream1, inStream2, outputStream);
//close the output FileOutputStream
outputStream.close();
Can you please share some further details which can help us in replicating this problem.
PS, By the way, I did not notice that you have closed the output stream in your code, as highlighted above.
Hi,
Hi Mani,