• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Help about PageFormat (Print)

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!!
I need your help. I want to print some text in PORTRAIT and another text in LANDSCAPE in the same page.
I'm triying to do this with the next code:
Graphics.drawString("TEXT IN PORTRAIT", 10, 10);
//Change orientation
PageFormat.setOrientacion(PageFormat.LANDSCAPE)
Graphics.drawString("TEXT IN LANDSCAPE", 10, 10);
But it doesn't work.
Thank you.
 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I think, this doesn't work in this way. You can't change the PageFormat during printing.
Seems to me, that you want do do something like a crossword. You have to do some calculations in your paint method if you want to do so.
Maybe you have a look to java.awt.font package. I think this feature already exists.
 
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic