pdfbox: how to clone a page
Using Apache PDFBox, I am editing an existing document and I would like to take one page from that document and simply clone it, copying whatever elements it contains. As an additional twist, I would like to get a reference to all the PDField s for any form fields in this newly cloned page. Here's the code I tried so far: PDPage newPage = new PDPage(lastPage.getCOSDictionary()); PDFCloneUtility cloner = new PDFCloneUtility(pdfDoc); pdfDoc.addPage(newPage); cloner.cloneMerge(lastPage, newPage); // there doesn't seem to be an API to read the fields from the page, need to filter them out from the