I want to print an incremental count on the top right corner of my labels from my Zebra printer using ZPL - zebra-printers

I currently know how many labels I want to print and use ^PQ# to print that amount but the trouble is getting an incrementing count printed on the corner of each label.
There are a couple problems right now. First is that Zebra doesn't have anything letting me print the odometer value on the zebra printer. It will kind of let me print the number of centimetres or inches using ~WQOD, but it comes with a lot of extra information that I don't want. I couldn't find any commands in the manual just letting me print the number of labels with the reset-able odometer.
I could create a counter outside of the printer then send a request to print each label with a new number on the top right, however, that overloads the printer and causes connection issues with the printer if I print too many labels.
Are there any ways to overcome either of those issues so I can print an incrementing counter on each label?

The command to print a sequence of numbers across labels is ^SN. It is specifically used with ^PQ.
^SN001,1,N^FS
^PQ3
To not overload the printer, send all individual labels within one connection, as a single string stream, don't open a separate connection for each.

Related

how correctly set the label positioned in the middle of the label with zpl code

My code is here:
http://staging.advanced-technology-group.com/?density=8&quality=grayscale&width=4&height=6&units=inches&index=0&zpl=%5EXA%0A%0A%5ECI28%0A%5ECWZ%2CE%3ATT0003M_.FNT%0A%5EFS%5EXZ%5EXA%5EFWN%5EFO70%2C50%5EA0%2C30%2C25%5EFH%5EFD_ce_8e%0A%5EFS%5EFO70%2C90%5EBY2%5EB3%2C%2C100%5EFDtestprodcuct%5EFS%5EXZ
The problem i face, is that i calibrate the zebra printer (gc 420t) with the following:
hold the feed button, the led blinks once, then twice, then i release the feed button.
Then i notice that half of the label is not printed. Given that i use the above offsets. What should one do? There are two ways to make the label print correctly. Either with the printer make it print the label in the middle, or with putting instead of 70, a larger value in the FS command. How would you suggest i should proceed? If i use the code, is there a command to use instead of FS, a command that would tell the printer to print the label in the middle of the paper?

ZPL batch print ship label issues...memory limit?

We have a web app that batches the ZPL for many shipping labels (UPS, USPS, FedEx) at a time. For some reason it will randomly mis-print where is just prints the barcodes, but nothing else. This usually only starts after about label 20 or so in the batch, and even then, it is not consistent in the labels after that. Sometimes it does it, sometimes it doesn't. It is consistent in that it does it to the USPS labels and not UPS or FedEx.
If we reprint just that label's zpl, it prints fine.
So I was wondering if there is some limit we're running into with batching. We send just one long zpl string for the entire batch, each label separated with ^XA....^XZ.
The printer is a GX420T.
Any ideas?
Example mis-print - I drew black lines on the barcodes to make them not readable for privacy

How do I print multiple ioComp Plotx plots to a Nova PDF 'printer'?

I am trying to print the images from the ioComp iPlotX object to a PDF printer. This object has iPlotX.SaveToBitmap, which does work and I can 'send' the file to the PDF printer, but the image is blurry, the bitmap is 96 DPI.
The control has iPlotX.PrintChart method which is supposed to go directly to a printer. There is also a method to indicate which Windows printer to direct the output to. I fumbled around to see if I could get anything to work and a couple times I produced an image in the PDF file that was very clear. But other items printed to the page were gone and I only had one page instead of 3 pages. Most of the times nothing is in the PDF file.
A snippet of my relevant code is below.
Me.SinglePlotObject1(iIndex).PlotControl.PrintShowDialog = False
Me.SinglePlotObject1(iIndex).PlotControl.Printername = modNovaPDFConstants.NOVAPDF_PRINTER_NAME
Me.SinglePlotObject1(iIndex).PlotControl.PrintOrientation = poLandscape
Me.SinglePlotObject1(iIndex).PlotControl.PrintChart
This note is from the ioComp.Help:
Note : If you have set PrintShowDialog to TRUE and have set
PrinterName to a non-empty string, then the printer selected by the
user will be ignored! The PrinterName property will always override
the user printer selection, if you are using our printer dialog If
you plan on showing our built-in printer selection dialog to your end
user, then you should set the PrinterName property to an empty string
for everything to work correctly.
Also from their help is :
property PrintXStart : Double Used to specify the starting x-axis Min
value when implementing multi-page printing.
Description: Use PrintXStart to get or set the starting x-axis Min
value when implementing multi-page printing. By default, the
PrintXStart and PrintXStop are initialized to the Min and Max of the
x-axis display on the screen and will only print out one page. You
must manipulate the PrintXStart and PrintXStop in the OnBeforePrint or
OnBeforePrintPage event to have multiple pages print out during a
single print session.
The only example they show is setting the XStart property to 0. I am not sure if this means multiple pages for the same graph, that is, the graph is stretched out over multiple page or is this has something to with different iPlots on separate pages. In the past we have always just used the iPlotX.SaveToBitmap to print. At that time the plots and text were good enough.
If anyone has any experience with ioComp plot controls and printing, I am willing to try any suggestions.
Right now I am trying to create a test application with as little code as possible to test all of their other printer options.
I have tried their FAQ section but could not find anything related to printing using VB6 and the ActiveX controls. When I sent a message to them, a smtp error appeared.
DaveInCaz: Good Idea. I tried a different PDF printer and results are the same. I tried a method of the control called iPrintToDC, passing in the Printer.hDC. This made some progress. I can print two graphs on two pages, but the graphs are about the size of my thumb. If I change width's or height's, it only makes things worse, by somehow placing the bottom of the graph 'above' the title and removing all the contents of the graph itself; it is as if the graph is wrapped around a cylinder and all I see is where the top and bottom meet. When I used the .PrintChart method, only the last of two charts would be printed and nothing else I printed would appear.
Thanks.

ZPL Can I trick the printer into thinking I printed two labels?

I have a label stock that has two labels side by side, so I've written my code to print identically on both of these labels.
The issue is that a printer sees this as one label, but I need it to see them as two. How then, could I possibly trick the printer into thinking two labels have been printed?
If ZPL can print 2 separate pieces of code on one label this might be possible. If there's a command that makes a single label count as 2 then it's definitely possible.

Estimate ZPL Render And Print Times

I am working on a set of ZPL validation routines which parse arbitrary ZPL files, sanitize them, edit certain key commands (label length, print speeds, etc), and extract some useful information.
Since this printer is generating labels for a free-running shipping line I really need to know how long it's going to take from the moment I send the ZPL file to the printer until I'll be ready to apply the label. It is clear that the print time is directly linked to the label length and print speeds, but the label render time (conversion of ZPL into ready to print image in printer memory) is less obvious.
Since I'm printing label contents provided by numerous third parties, I can't simply measure the time for the labels. I've asked Zebra and gotten no guidance, so I'm wondering if anyone has an idea of how to estimate the render time? Am I stuck trying to estimate the processing time of every individual ZPL command?
My experience over the last couple of years working with differnt zebra printers (Z4M, ZM400, GK420t) is, that the label that is send to the printer is printed almost instantaneously.

Resources