I'm trying create java application that merge three pdf. First two pdf I combine normal without resize and rotate. The last one pdf I want to rotate and place two pdf page into one pdf page.
I used iText 5.5.13. I tried merge two pdf and It's works.
public void mergePdf(List<File> pdfFiles, File outputFile) {
try {
Document document = new Document();
FileOutputStream outputStream = new FileOutputStream(outputFile);
PdfCopy copy = new PdfSmartCopy(document, outputStream);
document.open();
for (File inFile : pdfFiles) {
PdfReader reader = new PdfReader(inFile.getAbsolutePath());
copy.addDocument(reader);
reader.close();
}
document.close();
} catch (DocumentException | IOException ex) {
ex.printStackTrace();
}
}
I don't know how merge with rotate and resize two page into one pdf page.