Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

AWT Printing Landscape/Portrait

 
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!
 
The City calls upon her steadfast protectors. Now for a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!