2
votes

We have 5 xsl files, the xml content for transformation genertated at runtime, it is working fine when we are generating a single pdf for single xsl file.

Our requirement is we need to generate a single pdf for the 5 xsl files based on runtime input.

ex: the input is 3 xsl file name then we need to genrtate a single pdf containg the 3 xsl contents in multiple pages.

We are using Apache FOP 1.0 and Java 1.5.

Thanks in advance

Thanks -Arul

1

1 Answers

0
votes

As you're already able to convert the XSL to PDF, you may try to concatenate multiple PDF files, created from those XSL files, into a single PDF using Aspose.Pdf.Kit for Java. The code is very simple:

//read the input file
String inFile1 = "example1.pdf";
String inFile2 = "example2.pdf";
String outFile = "kitOut1.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();

Disclosure: I work as developer evangelist at Aspose.