}
return outputFile;
}
private void writeCollection(String collectionFilename, FileOutputStream streamOut) throws DocumentException {
PdfCopyFields collection = new PdfCopyFields(streamOut);
for (String producedFile : producedFiles) {
FileInputStream streamIn = null;
try {
streamIn = new FileInputStream(outputfolder + File.separator + producedFile);
PdfReader reader = new PdfReader(streamIn);
collection.addDocument(reader);
} catch (Exception e) {
noticeTexts.add("ERROR: could not add " + producedFile + " to " + collectionFilename + " : " + e);
} finally {
FileUtils.close(streamIn);
}
}
collection.close();
}