Printing PDF with mixed Orientation | Community
Skip to main content
November 21, 2024
Solved

Printing PDF with mixed Orientation

  • November 21, 2024
  • 2 replies
  • 903 views

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!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by EstebanBustamante

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

2 replies

EstebanBustamante
Community Advisor and Adobe Champion
EstebanBustamanteCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
November 27, 2024

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
kautuk_sahni
Community Manager
Community Manager
December 16, 2024

@vikaswa Did you find the suggestion helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!

Kautuk Sahni