Expand my Community achievements bar.

Printing PDF with mixed Orientation

Avatar

Level 1

I am using the PDFBox Java library to generate a PDF document. In this document, I have a few pages in portrait orientation and some in landscape orientation. When I print this document in duplex mode, the portrait pages are bound on the long edge, while the landscape pages are bound on the short edge. Is it possible to set printing options in the document so that the binding is always on the long edge, regardless of the page orientation within the document?

Thank you!

1 Reply

Avatar

Community Advisor

Hi,

 

First, I'd like to point out that this community is dedicated to supporting Adobe products. Since your question is specifically about PDFBox, I believe you'll find more relevant answers in a forum focused on PDFBox or Java-related topics. That said, I think what you can try is something like the following:

 

PDPage page = new PDPage(PDRectangle.A4);
page.setRotation(90);  // Rotate landscape pages 90 degrees
document.addPage(page);

References:

https://stackoverflow.com/questions/40611736/rotate-pdf-around-its-center-using-pdfbox-in-java

https://lists.apache.org/thread/69b6p6lcm2vrgsy7dm3mypq1rtqzsc5s 

 

Hope this helps



Esteban Bustamante