ZPL not working correclty in vb6

rjef
rjef used Ask the Experts™
on
why do I not get all the data when I run these ZPL commands in vb6

Private Sub Command5_Click()
Printer.Print "^XA"
Printer.Print "^FO100,100"
Printer.Print "^BXN,6,200"
Printer.Print "^FDZEBRA TECHNOLOGIES CORPORATION 333 CORPORATE WOODS PARKWAY VERNON HILLS, IL 60061-31 09ZEBRA TECHNOLOGIES CORPORATION 333 CORPORATE WOODS PARKWAY VERNON HILLS, IL 60061-3109^FS"
Printer.Print "^XZ"
Printer.EndDoc
End Sub

Open in new window

but if I use notepad with just the zpl and a generic text driver it prints all the data in the 2d barcode
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
IT / Software Engineering Consultant
Top Expert 2016
Commented:
At first look this seems reasonable.  A few questions.

  1. Did this ever work for you, or is this your first try?
  2. Can you see the print "job" getting started in the printer queue and then going away after a short time?
  3. When you print from the VB application, is the default printer set to the bar code printer, and using the text driver?
  4. Does anything print at all, or nothing?


»bp

Author

Commented:
1 first try
2 yes I get the printer out but in the 2d barcode the data is missing
3 text driver
4 yes the label prints but missing the data inside the 2d barcode
Bill PrewIT / Software Engineering Consultant
Top Expert 2016

Commented:
Okay, what you have seems reasonable.  You might try sending all the data as one line to see if VB Print is maybe adding some extra characters or line breaks.

Private Sub Command5_Click()
Printer.Print "^XA^FO100,100^BXN,6,200^FDZEBRA TECHNOLOGIES CORPORATION 333 CORPORATE WOODS PARKWAY VERNON HILLS, IL 60061-31 09ZEBRA TECHNOLOGIES CORPORATION 333 CORPORATE WOODS PARKWAY VERNON HILLS, IL 60061-3109^FS^XZ"
Printer.EndDoc
End Sub

Open in new window


And now that I say that perhaps it's a line length limitation of some sort, you might try a test with much shorter data for the barcode so that line is less than 80 characters.

Just trying to get some clues...


»bp
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Bill PrewIT / Software Engineering Consultant
Top Expert 2016

Commented:
Also you might try setting the line length with something like:

Printer.TextWidth 250

and see if that works.


»bp
Theo KouwenhovenApplication Consultant

Commented:
Hi rjef,

  1. To be sure that there is no printer-driver, that messing-up something in the label, You can try to FTP it to the printer then you are sure that no info is added (or changed)
  2. You can also send it to a textfile or an not zpl-printer, than you can check the data send by the program.

Author

Commented:
thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial