Skip to main content

Printing on a Labelprinter..

4 replies [Last post]
szahn
Offline
Joined: 2007-11-28

Hi!
I need to print labels on a label printer (Especially a Brother P-Touch 9500PC)
..Anyway I'm able to print on it just as a usual printer.
I just don't get the PageFormat and the paper set correctly..the ImageableX() and ImageableY() are right in the middle of the label and everything is mixed up...

Can you guys help me?
My labels are 9mm(0.354inch) high (endless roll) and i want a length of maybe 2mm(0.787inch)

Thanks in advance

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
szahn
Offline
Joined: 2007-11-28

Yes I tried that...but what happenes is that if I change the imageable X it seems that the imageable Y also changes somehow....i'm a bit frustrated with the label printer. Maybe there is a bug in the windows driver..
Could you post me some code of how you change your pageformats? so that i can look up if i did something wrong?!...
...and is it okay to put the "graphics.transform(pageFormat.getImageableX(), pageFormat.getImageableY()) ???
and what is the "setClip()" method for? and what unit does setClip want? Inch? 1/72 inch? I'm pretty confused :D

HELP

pietblok
Offline
Joined: 2003-07-17

Hi,

A recent thread discussed problems with paper size.
http://forums.java.net/jive/thread.jspa?threadID=32200&tstart=15

In that thread I provided a link to a working sample that uses Paper and PageFormat
http://www.pbjar.org/docs/src/org/pbjar/games/swing/PrintAction.java

Hope this helps,

Piet

szahn
Offline
Joined: 2007-11-28

thanks for your help but it still doesn't work..the printer just behaves weird :)
I changed the paper size to my default paper size and the printer just mixes it up.
Actually I see my JComponent i printed out, but it is not aligned on the paper...it's even not scaled into the paper size..it's just "somewhere" .......
Any more ideas?
This is frustrating..I hate brother ;)
Maybe does anyone know a good label printer you can use out of java? The labels need to be thermotranfer..no paper...

Jennifer Godinez

Hi Szahn,

Have you tried to use PrinterJob's pageDialog to modify PageFormat? You
can also change the imageable x & y by using Paper's setImageableArea.

- Jennifer

java2d@JAVADESKTOP.ORG wrote:
> Hi!
> I need to print labels on a label printer (Especially a Brother P-Touch 9500PC)
> ..Anyway I'm able to print on it just as a usual printer.
> I just don't get the PageFormat and the paper set correctly..the ImageableX() and ImageableY() are right in the middle of the label and everything is mixed up...
>
> Can you guys help me?
> My labels are 9mm(0.354inch) high (endless roll) and i want a length of maybe 2mm(0.787inch)
>
> Thanks in advance
> [Message sent by forum member 'szahn' (szahn)]
>
> http://forums.java.net/jive/thread.jspa?messageID=247624
>
> ===========================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in the body
> of the message "signoff JAVA2D-INTEREST". For general help, send email to
> listserv@java.sun.com and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".