• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Printing Labels in Java

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am trying to print out envelope labels via a Java app, I can get it to print out an address on a normal sheet of A4. However envelopes get loaded into the printer length-ways so when the address is printed out it is printed out at 90 degrees to the way it should be.
Does any Java genius know how to spin the text I want to print 90 degrees so that the address is printed correctly or is there another way of printing envelope labels correctly?
Thanks
Dave
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found the javax.print.attribute.standard which has an OrientationRequested class described in the API. I haven't used this myself so I can't help further but it looks a likely candidate for what you need.
 
Dave Matthews
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmm, I tried setting the orientation, because as you said it seems to be the way to go but had no joy.
Does anyone else have any ideas?
 
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We print specialized labels through a Java applet, and we always write the text to an image before sending it to a printer (it might be easier for you to manipulate). I just found this with Google:
http://www.subrahmanyam.com/javaapps/rotate/RotateTextDemo.html
Here's an article where they mention rotating text in Java:
http://www.macdevcenter.com/pub/a/mac/2002/03/22/vertical_text.html
 
reply
    Bookmark Topic Watch Topic
  • New Topic