This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes AWT Printing Landscape/Portrait Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "AWT Printing Landscape/Portrait" Watch "AWT Printing Landscape/Portrait" New topic

AWT Printing Landscape/Portrait

M Barr

Joined: Oct 12, 2011
Posts: 1

Hello all, thanks for any help in advance.

I'm currently attempting to print from AWT with Graphics2D and a Pageable object to a print driver that converts the printout to PDF(PDF995). For everything to be formatted correctly I need to print everything in portrait, with the width and height sized according to the actual orientation. Everything works perfectly, except if I print landscape, it will stay landscape after that. It will not switch back to portrait. It will print portrait, then landscape, but not vice versus. Here's the code for generating the PageFormatObject, BBrPageData is a Printable class that contains page constraints and the data to print on the page. It should be redundant to clone the paper, then set the sizes from the class, but I was covering all my bases.

I know this isn't much to go on, but if anyone can point me in a direction to try, I'd appreciate it. I've tried every combination of setting the orientation, not setting it, reversing the constraints, etc. So fresh eyes would be great. Thanks again!
I agree. Here's the link:
subject: AWT Printing Landscape/Portrait
It's not a secret anymore!