Hi,
I try to rotate Page 1 from document A and move that page as page 1 to document B. Document B has to be created on the fly. The rotation itself works as well as the merge of the page to a new document. The problem is, that the remaining page 2 of Document A is rotated instead of the moved page 1 in document B:
Document doc1 = new Document(“foo.pdf”);
PdfPageEditor pdfPageEditor = new PdfPageEditor(doc1);
Map<Integer, Integer> rotations = new HashMap<>();
rotations.put(1, 90);
pdfPageEditor.setPageRotations(rotations);
pdfPageEditor.save(“foo.pdf”);
Document doc2 = new Document();
Page pageToMove = doc1.getPages().get_Item(1);
doc2.getPages().insert(1, pageToMove);
doc1.getPages().delete(1);
doc1.save(“foo.pdf”);
doc2.save(“bar.pdf”);
Am I missing something?