slloyd has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to print to a Zebra Thermal printer using ZPLII (Zebra Programming Language -- http://www.servopack.de/Files/HB/ZPLcommands.pdf)

Any ideas on how to approach this with Perl? It will to run on M$ Windows.

-------------------------------
Need a good Perl friendly Host Provider?
http://www.dreamhost.com

  • Comment on Printing to a Zebra Themal Printer using ZPLII

Replies are listed 'Best First'.
Re: Printing to a Zebra Themal Printer using ZPLII
by Old_Gray_Bear (Bishop) on Jun 04, 2007 at 22:38 UTC
    I did a cursory scan through the Introduction of the document, and that pointed me at the "Examples" section. If I read correctly, you format your document using their mark-up language(ZPL) and then "save the document and copy it to the printer" (one assumes they mean drag-and-drop, since it appears to be a Windows only device). So, you might be able to send the command string to the printer using print(). It would be worth a try. (If this particular brand of bar-code printers is fairly popular in the Wild, this might well be a good module to develop for CPAN.)

    Good luck, let us know what you find out.

    ----
    I Go Back to Sleep, Now.

    OGB

Re: Printing to a Zebra Themal Printer using ZPLII
by robot_tourist (Hermit) on Jun 05, 2007 at 09:35 UTC

    Sounds like Intermec Print Language. We use some Intermec printers at work, but mostly with stored labels and mostly via Delphi/Windows and nearly always over the serial port (using an in-house rs232 module). We have one system that uses Perl on HP-UX with the serial port. It writes the label data to a file and then does a system call to read the file with the 'cat' command and pipe the output of that cat command to the 'cu' utility, which does all the talking to the printer.

    For a windows environment, I suppose you could do something similar by building your label up and then telling the shell to write it to the serial port.

    How can you feel when you're made of steel? I am made of steel. I am the Robot Tourist.
    Robot Tourist, by Ten Benson

Re: Printing to a Zebra Themal Printer using ZPLII
by kermada (Initiate) on Jun 05, 2007 at 13:19 UTC
    Just use the printer as a "Generic Text Printer" and print to the com port as a string of text. Use the examples by the copy or type method: type example.txt > com1: And base your perl script on how well the sample files you copy to the printer. Also pay attention to the fonts used, not all are stored on the printer. Dave