[ic] Linux label printers

Jon prtyof5 at attglobal.net
Tue Jan 18 00:22:37 EST 2005



> > > I've got a decoded digital TIF to print now, but I need to figure out
> > > how to get the printer to spit it out.  I'm going to tinker with it
> > > into the night I hope.
> > >
> > > Please let me know if you can offer any guidance on going from a Linux
> > > system with no printing set up, to a Linux system printing to one of
> > > these Zebra LP 2844s from within a usertag.
> > >
> >
> > Hi Grant,
> >
> > Some background for FedEx you may (or may not) find helpful.  The
> > Business::Fedex::DirectConnect my business partner wrote can return EPL code
> > instead of a raster PNG or GIF image.
> >
> > EPL (Eltron Printer Language) is an ASCII-based code when piped to any
> > Eltron or
> > Zebra printer supporting EPL (most do including yours) will quickly spit out a
> > label.  In a recent application, we simply opened a printer handle using lpd
> > and output the ASCII code.  Here is some psudocode:
> >
> > use Business::FedEx::DirectConnect;
> > my $t = Business::FedEx::DirectConnect->new();
> > $t->set_data(); $t->transaction();
> >
> > open PRINTERHANDLE, "| lp -d zebra" || die "Can't open printer!";
> > print PRINTERHANDLE $t->label;
> > close PRINTERHANDLE;
> >
> > This method does away with TIFFs, GIFs, PNGs or any other raster
> > images.  And I
> > am pretty sure UPS's API also supports EPL/ZPL as well.
> >
> > Hope this helps.
> >
> > - Brian
>
> Thanks Brian and Jon.  I'm getting more intimate with this and I
> realize the digital TIF will reside on the server and I need a way to
> send it to the local printer.  Looking at both Jon's and Brian's perl
> code and "man open" it seems like the open command is the way to go
> about this.  Do you guys execute an open command from within the
> usertag, or do you execute a local script that uses open?  If you are
> executing a local script, how do you get the label data from the IC
> server to the local machine?
>
> - Grant

All my shipping code runs on a local server where the printer is located which
is not where my IC server is located. My basic flow is to pull the order data from
the IC server to my local server and then send the request to FedEx from there.
FedEx returns the PNG file to my local server where I 'open' the ZEBRA and print
the PNG file 1 line at a time to the ZEBRA printer (this is Linux so file really
">/dev/ttyS0")

When I first embarked on this shipping I knew I had the dilemma of IC server not
being
physically located with me so I had to choose between communicating with FedEx
on the IC server and then get label file to a local printer or run everything on a
local
Linux box which meant pulling all the order specific data to my local Linux box.
I went with pulling order data to my local Linux box so I could write directly to
the printer.

Jon





More information about the interchange-users mailing list