Reputation: 633
We were using Acroforms before and able to generate multiple copies of the same form using PdfMerger. After we switched to XFA to handle dynamic forms, we are not able to generate multiple copies anymore. We are still using the same function which uses PdfMerger (similar to the code snippet below):
PdfDocument pdf = new PdfDocument(new PdfWriter(dest));
PdfMerger merger = new PdfMerger(pdf);
//Add pages from the first document
PdfDocument firstSourcePdf = new PdfDocument(new PdfReader(SRC1));
merger.merge(firstSourcePdf, 1, firstSourcePdf.getNumberOfPages());
//Add pages from the second pdf document
PdfDocument secondSourcePdf = new PdfDocument(new PdfReader(SRC2));
merger.merge(secondSourcePdf, 1, secondSourcePdf.getNumberOfPages());
firstSourcePdf.close();
secondSourcePdf.close();
pdf.close();
Upvotes: 0
Views: 53