File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes EPL2 - Load image into to Zebra printer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "EPL2 - Load image into to Zebra printer" Watch "EPL2 - Load image into to Zebra printer" New topic

EPL2 - Load image into to Zebra printer

Jeppe Sommer
Ranch Hand

Joined: Jan 07, 2004
Posts: 270

I an trying to load a graphic image directly into a Zebra desktop printer (TLP 2844). To do that I am going to use the language called EPL2, which is command syntax language.

Below you see the command syntax:

Syntax: GWp1,p2,p3,p4DATA

Parameters p1 = Horizontal start position (X) in dots.

p2 = Vertical start position (Y) in dots.

p3 = Width of graphic in bytes. Eight (8) dots = One (1) byte of data

p4 = Length of graphic in dots (or print lines).

DATA = Raw binary data without graphic file
formatting. Data must be in bytes. Multiply
the width in bytes (p3) by the number
of print lines (p4) for the total
amount of graphic data. The printer automatically
calculates the exact size of
the data block based upon this formula.

My questions are:

1) How to we get the width of graphic in bytes?

2) How to we get the height of graphic in dots?

3) We need to send raw binary data in bytes as the DATA parameter. Do we have to convert it into a string, like below:

Thanks in advance
I agree. Here's the link:
subject: EPL2 - Load image into to Zebra printer
It's not a secret anymore!