I need to print on my Zebra (Lan/USB) from a CSV file using a PowerShell script.

// Expert user has replied.
A Angel Bolos 3 years 3 months ago
944 3 0

I tried something like this but it doesn't work:

Get-Content -Path C:\Users\xxxx\Documents\print.csv | Out-Printer

Please, someone can help me?. Thank you.

Please Register or Login to post a reply

3 Replies

S Steven Si

Zebra printers do not support PowerShell. To print labels on Zebra printers, you would need to create an application with Link-OS Multiplatform SDK.

W Ward Christensen

What does your CSV look like? Since CSV files are numbers and double-quoted strings, with comma separators, there is no way to "send that to a Zebra" as it contains no font, positioning, etc information!

I print to my TLP-3844-Z from Mansfield Software Kedit. So "Zebra doesn't support Kedit" is FALSE, because all the Zebra sees is the text stream coming from a character mode driver.

I found a "text" printer driver for my Zebra, and so the "print" command in Kedit is how I print ALL my labels.

SO if:
1) your CSV file is in actuality a bunch of ZPL statements (unlikely by the very definition of CSV)
- and-
2) you have a simple text driver set as your default printer,
-then-
you should be able to print via power shell, because the Zebra printer doesn't SEE powershell, it sees a character stream with ZPL commands.
IF on the other hand, your CSV file is the raw data you want printed "formatted" on your printer, i.e. if it were "name","streetaddr","City","State","zip"
and you wanted that printed as 3 lines, then you need a fair amount of ZPL code to send to a text-only driver to your Zebra printer.

Just to be sure, remember Out-Printer in PowerShell is the default printer, so you have to set the default printer to your text-output zebra printer.

Here's a file that would print a name and address, but you've have to write a program in "some language" to parse the CSV and move the fields into the right places:
^CF0,50
^FWB
^FO70,250
^FDJewel/Osco^FS
^FO134,250
^FDM.S. 10501^FS
^FO200,170
^FDP.O. Box 29093^FS
^FO270,100
^FDPhoenix, AZ 85038^FS
^XZ

___________
It would help if you show us the format of your CSV file, and a copy of what you want the output to look like.

/Ward Christensen

W Ward Christensen

https://www.foldermill.com/kb/install-generic-text-driver-in-windows
This is what I did, and now I can just set up my default printer and copy stuff to it which is a file of ZPL code.

/Ward Christensen

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