generate multiple reports in a single pdf using odt in xdocreport

930 views Asked by At

I am printing reports using odt with xdocreport in Java.

But now I want to print multiple reports of same document in a single pdf file using xdocreport.

Can any one can tell how to generate multiple reports in a single pdf file

1

There are 1 answers

0
alh84001 On

You could use PDFBox and it's PdfMergerUtility class. Something like this.

PDFMergerUtility pdfMerger = new PDFMergerUtility();
for (File singleReport: pdfReports) {
    pdfMerger.addSource(singleReport);
}
pdfMerger.setDestinationFileName("path/name");
pdfMerger.mergeDocuments();