Re: Print barcode to a Printer

Jeremias Maerki <[email protected]> Tue, 02 Dec 2003 21:11:52 +0100
Newsgroups gmane.comp.krysalis.user
Message-ID <[email protected]>
On 02.12.2003 19:14:27 Claudio Pi wrote:
> First of all I must say I am totally new to barcodes, so for my "newie"
> questions. 
> 
> The situation I'm facing is that I have been asked to print a barcode
> to an Epson TM-L60II Printer from a Java Application. 
> 
> Searching for barcodes I found Krysalis, and found it really
> interesting and flexible. 
> But I don't know if it is the right solution for my problem.  As far as
> I could see the solution with Krysalis to my problem would be
> generating an image with the barcode, and then sending that image to
> the printer (for example with the Java Printing API of JDK 1.4.) Am I
> right ?

That is one possibility, yes. There seems to be a page mode for the
printer (in contrast to endless mode) so there will most likely be a
printer driver available.

> I also found the Java Pos specification http://www.javapos.com that
> allows me to print barcodes to a POS printer. Together with EPSON Java
> Pos implementation http://pos.epson.com/pointofsale/jpos.html I think
> It could also be a solution to my problem. 

I'm not familiar with JavaPos, but a quick glance into the specification
tells me that printing barcodes is supported. So if you work with Java
anyway, I'd give it a try. If you use Krysalis Barcode for the barcodes
you may end up using JavaPos anyway to print the barcode, if the printer
driver (via Java Printing System) doesn't satisfy you. And if you use
JavaPos you can easily use its barcode facilities.

> Also the printer comes with a Visual Basic example that opens the
> printer and send special characters to the printer (example it sets the
> font of the printer to "control" and then sends a "n" char)  to this
> kind of Job but it isn't clear to me how to do this with Java.

I believe with JavaPos you'll be able to easily send such commands
directly to the printer. As far as I know it is possible to create
barcodes with a few easy commands to the printer without having to build
up a bitmap first. This is an important feature because transferring a
bitmap over an RS-232 interface will take relatively long which may (!)
slow down the printing process considerably. The EPSON printer you
mention supports UPC and EAN barcodes only (if my information is
correct). If that is sufficient I'd go for the
build-barcodes-by-control-commands solution. It will certainly be faster
and you don't have to worry about any resolution settings to get optimal
barcode readbility.

> What do you suggest me ? Can I use Krysalis for this situation ? 

You can. But for performance reasons in your particular situation (POS
printer accessed via RS-232) I'd recommend sticking with the printer's
built-in barcode facility if possible (either JavaPos or the printer
command language).

I hope that helps. Good luck, and I'd be interested to hear what you
did in the end and how it worked out (Krysalis Barcode or not).

Jeremias Maerki



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/