aspose file tools*
The moose likes Java in General and the fly likes Printing Labels in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Printing Labels in Java" Watch "Printing Labels in Java" New topic
Author

Printing Labels in Java

Dave Matthews
Greenhorn

Joined: Jun 11, 2002
Posts: 15
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

Joined: Dec 13, 2003
Posts: 18
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

Joined: Jun 11, 2002
Posts: 15
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

Joined: Jul 15, 2003
Posts: 618
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Printing Labels in Java