Is there a way to use a standard label form and use ZPL to print these
barcodes.
Typically how this is done using the ZPL language is you send the printer
control codes to the printer (similar to PS and HP PCL). But all we've been
able to do to make this work, is send the printer control codes directly to
the printer through DOS. We have to create a text file and then sent it to
the printer from DOS by doing a "COPY text.txt > LPT1" which is far from
practical. We would like to do this from within a label form.
Any ideas how? How do you send printer commands to a printer through a
label form (or report form)???
Thanks,
John G.
you can use the command:
file_text=text.txt
! command /ctype &file_text >prn
in this way u can print direct from vfp6
Sergio MArchi
I have had this problem with ZPL. It's pretty much true for most barcode
printers, as they all seem to have similar 'languages'. This was several
years ago, in Fox 2.6 (which the customer is still using).
I never was successful in using a label or a report to do my printing,
mainly because neither delivers x/y position information to the printer. The
label and report forms drive x/y positioning through spaces and tabs (for x)
and cr/lf (for y).
What I ended up doing was writing a little 'driver', which consisted of a
set of functions - reset, line, text, barcode, etc. Each function would take
an appropriate set of arguments (for example (x1,y1,x2,y2) for the line
function). The functions were coded to output (using ???) the appropriate
ZPL strings. To print out a particular label, you could string together the
set of functions needed to do the job.
I took this a couple steps further by making several sets of 'driver'
functions, which set was used was determined by the operator at run time (we
had some non-ZPL printers, also).
Finally, rather than having to code and compile a program to make a label, I
created a little database that contained a list of commands and parameters,
and made a little universal processor that would pass a database and call
the appropriate functions (from the desired driver). This was done because
we have several customers who require differing barcode formats (the joy of
EDI).
At one point, I had written a C++ Windows program that was a sort of WYSWYG
way of building and modifying the databases. But the Windows program only
gets you close (there were concessions...), so the majority of my label
tweaking is accomplished through trial and error with the database.
Marc