Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Printing Labels in Java

 
Dave Matthews
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • 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
 
Gillian Bladen-Clark
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • 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
  • 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?
 
Stephen Huey
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic