I have a .ZPL file that I need to print in VB.NET

G Gordon Jones 3 years 4 months ago
833 1 0

I have the USDA.ZPL file ready to print but I need to know how the print the file in vb.net example -

                writer.Write("^FT60,1750^A0B,42,40^XGE:USDA.ZPL^FS^") or

                writer.Write("~DGR:USDA.ZPL,05852,028,") or

                writer.Write("^FO200,0^XGR:USDA.ZPL,2,2^FS") ' Print the graphic

tried all 3 and not getting any output..

I can print the graphic (.ZPL file) using the following

   ' ''
                Dim LabelFileName As String
                LabelFileName = "C:\Users\gordonj\Downloads\USDA.ZPL"
                '
                Dim filename As String = System.IO.Path.GetFileName(LabelFileName)

                System.IO.File.Copy(
                               LabelFileName, ("\\par-ps-01\ParZebra\" & filename))

But cannot control where the graphic prints since it is not controlled by zpl language..

Please Register or Login to post a reply

1 Replies

D Dmitry Prokhorov

Hello Gordon,

I suppose your USDA.ZPL file contain ZPL commands. As you can see here:
https://www.zebra.com/content/dam/zebra/manuals/printers/common/program…
https://www.zebra.com/content/dam/zebra/manuals/printers/common/program…
~DG and ^XG ZPL commands are intended to work with .GRF file format that can be produced by ZebraDesigner from .PCX file.
The ~DG command is to store .GRF file on printer and ^XG command to recall it from there and print.
Mentioned commands will not work with ZPL file stored on printer.

Working with Hex Graphic ImagesZPL II can be used to save graphic images in HEX format in DRAM, FLASH, or PCMCIA, dependingon the type of memory installed in your printer. ZPL II can be used to save graphic images in HEXformat in DRAM, FLASH, PCMCIA, or battery backed up SRAM, depending on the type of memoryinstalled in your printer. The image might be created using a CAD program, a draw or paint program,or a scanner. These images can then be printed on the label. Graphic images may be created usinga program that creates files in the .PCX format. These files must then be converted to ZPL II graphicformat .GRF (pure hexadecimal data without headers or other extraneous information) for use aspart of a label format.You can use ZebraDesigner or ZebraNet Bridge Enterprise to convert the .PCX graphic format intothe pure hexadecimal .GRF graphic format. Hexadecimal data may also be directly input as part of aZPL II program. Manually preparing a string of HEX code is possible but usually impractical.Please, see here for details on how to work with hex graphic images:
https://www.zebra.com/content/dam/zebra/manuals/printers/common/program…

Dmitry Prokhorov
Software Engineer, Kutir Mobility
Posted on behalf of Zebra Technologies

CONTACT
Can’t find what you’re looking for?