This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

AWT Printing Landscape/Portrait  RSS feed

 
M Barr
Greenhorn
Posts: 1
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!