Rotate and merge

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?

Hi Mario,


Thanks for contacting support.

We are trying to replicate the issue in our environment and will get back to you soon. We are sorry for this delay and inconvenience.

Hi Mario,


Thanks for your patience.

I have tested the scenario using Aspose.Pdf for Java 11.0.0 where I have used my sample PDF files and as per my observations, only first page of Document A is being rotated to 90 degrees and also in resultant Document B, the single page is also rotated. Can you please share your sample PDF files, so that we can test the scenario in our environment.