How To Print Zpl File To Zebra Printer

/
  1. How To Print Zpl File
  2. How To Print Zpl Files
  3. Send Zpl File To Printer
  4. Zebra Printer Zpl Commands
  5. Zpl File Editor
Viewed 4k times

I'm trying to get this as simple as possible for our users.

Currently I go to a website, program shipping info, and it gives me a file in .ZPL format to print. This is just a text file renamed .ZPL with Zebra Programming Language in it.

When they open this file, I want it to immediately prompt for which printer it should go to. That's it.

Product sold by third party: This product was sold by a third party. Hp scanjet g2410 installation software. Product has been exchanged: This product has been exchanged for a new or refurbished product. Please use the product number and serial numbers of the new product to validate warranty status. Product sold without warranty: This product was sold by a reseller. Any warranty support needed would be completed by the third party that sold the product.

I've ran the below in command line to associate .ZPL to auto print in Notepad but it tries to go to the default printer. I need a way for it to allow the user to choose which printer it needs to go to. My only alternative is to have them open it in notepad and trust them to press File -> Print which I don't. Any ideas?

assoc .zpl=zebrafileftype zebrafile=%systemroot%system32notepad.exe /p %1

fixer1234

How To Print Zpl File

22.1k14 gold badges55 silver badges89 bronze badges
SnarfSnarfSnarfSnarf

Browse other questions tagged printingzebra-printer or ask your own question.

The Zebra Technologies TLP 2824 printer is a direct thermal and thermal transfer bar code label printer that you can use for retail and other label applications. It is primarily used to print mailing labels and other specialty documents. This is the snippet Module For ZPL Printers (Zebra, etc) on FreeVBCode. The FreeVBCode site provides free Visual Basic code, examples, snippets, and articles on a. 2824 Desktop Barcode Label Printer. The Zebra LP2824 is a desktop printer which boasts a surprisingly compact footprint without compromising performance. 00 dpi), DP- 4.

Active1 year, 6 months ago

Typically, when I plug in my Zebra LP 2844-Z to the USB port, the computer sees it as a printer and I can print to it from notepad like any other generic printer. However, my application has some bar code features. My application parses some input and generates an in-memory string of ZPL. How would I send this ZPL data to my USB device?

PrintJason 'Bug' FenterJason 'Bug' Fenter
1,3611 gold badge11 silver badges23 bronze badges

8 Answers

I found the answer.. or at least, the easiest answer (if there are multiple). When I installed the printer, I renamed it to 'ICS Label Printer'. Here's how to change the options to allow pass-through ZPL commands:

  1. Right-click on the 'ICS Label Printer' and choose 'Properties'.
  2. On the 'General' tab, click on the 'Printing Preferences..' button.
  3. On the 'Advanced Setup' tab, click on the 'Other' button.
  4. Make sure there is a check in the box labeled 'Enable Passthrough Mode'.
  5. Make sure the 'Start sequence:' is '${'.
  6. Make sure the 'End sequence:' is '}$'.
  7. Click on the 'Close' button.
  8. Click on the 'OK' button.
  9. Click on the 'OK' button.

In my code, I just have to add '${' to the beginning of my ZPL and '}$' to the end and print it as plain text. This is with the 'Windows driver for ZDesigner LP 2844-Z printer Version 2.6.42 (Build 2382)'. Works like a charm!

Jason 'Bug' FenterJason 'Bug' Fenter
1,3611 gold badge11 silver badges23 bronze badges

I've found yet an easier way to write to a Zebra printer over a COM port. I went to the Windows control panel and added a new printer. For the port, I chose COM1 (the port the printer was plugged in to). I used a 'Generic / Text Only' printer driver. I disabled the print spooler (a standard option in the printer preferences) as well as all advanced printing options. Now, I can just print any string to that printer and if the string contains ZPL, the printer renders the ZPL just fine! No need for special 'start sequences' or funky stuff like that. Yay for simplicity!

Jason 'Bug' FenterJason 'Bug' Fenter
1,3611 gold badge11 silver badges23 bronze badges

Visual Studio C# solution (found at http://support.microsoft.com/kb/322091)

Step 1.) Create class RawPrinterHelper..

Step 2.) Create a form with text box and button (text box will hold the ZPL to send in this example). In button click event add code..

With this solution, you can tweak to meet specific requirements. Perhaps hardcode the specific printer. Perhaps derive the ZPL text dynamically rather than from a text box. Whatever. Perhaps you don't need a graphical interface, but this shows how to send the ZPL. Your use depends on your needs.

barrypickerbarrypicker
4,7762 gold badges44 silver badges58 bronze badges

You haven't mentioned a language, so I'm going to give you some some hints how to do it with the straight Windows API in C.

First, open a connection to the printer with OpenPrinter. Next, start a document with StartDocPrinter having the pDatatype field of the DOC_INFO_1 structure set to 'RAW' - this tells the printer driver not to encode anything going to the printer, but to pass it along unchanged. Use StartPagePrinter to indicate the first page, WritePrinter to send the data to the printer, and close it with EndPagePrinter, EndDocPrinter and ClosePrinter when done.

Mark RansomMark RansomHow To Print Zpl File To Zebra Printer
233k31 gold badges300 silver badges528 bronze badges

ZPL is the correct way to go. In most cases it is correct to use a driver that abstracts to GDI commands; however Zebra label printers are a special case. The best way to print to a Zebra printer is to generate ZPL directly. Note that the actual printer driver for a Zebra printer is a 'plain text' printer - there is not a 'driver' that could be updated or changed in the sense we think of most printers having drivers. It's just a driver in the absolute minimalist sense.

ThaeliThaeli

I spent 8 hours to do that.It is simple..

How To Print Zpl Files

You shoud have a code like that:

Change that variable content from 3 (open file already exist) to 1 (create a new file).It'll work at Windows 7 and XP.

Nunser
4,4138 gold badges20 silver badges35 bronze badges
Rodrigo AquinoRodrigo Aquino

Install an share your printer: localhostzebraSend ZPL as text, try with copy first:

copy file.zpl localhostzebra

very simple, almost no coding.

Send Zpl File To Printer

ThomasThomas

You can use COM, or P/Invoke from .Net, to open the Winspool.drv driver and send bytes directly to devices. But you don't want to do that; this typically works only for the one device on the one version of the one driver you test with, and breaks on everything else. Take this from long, painful, personal experience.

Zebra Printer Zpl Commands

What you want to do is get a barcode font or library that draws barcodes using plain old GDI or GDI+ commands; there's one for .Net here. This works on all devices, even after Zebra changes the driver.

Dour High ArchDour High Arch
18.5k16 gold badges68 silver badges81 bronze badges

Zpl File Editor

Not the answer you're looking for? Browse other questions tagged usbzebra-printerszpl or ask your own question.