Sending an ZPL Label to a Zebra printer - zebra-printers

I want to send a text file containing ZPL to a Zebra GC420 printer. The ZPL Manual asks me to send it to the printer from the DOS command prompt, but doesn't say how. I can send through the parallel port using PRN, and it works. But I cannot print through USB, and I cannot print from any Windows version above XP.

make zpl commmand text file
type 'copy printsample.txt lpt1' in dos command window

In the network printer, you can use the netcat (nc). It is available in Linux and in windows too.
netcat -N your.printer.ip 9100 <text_file_you_want
I checked it few minutes ago...

Related

How to print .txt file containing esc/pos commands using command prompt in windows?

I am trying to print ESC/pos commands from the .txt file using windows command prompt.
Let me explain what I tried so far:
I have connected my Epson Tm-m30 printer. Using a virtual port driver I can print the .txt file using the following command:
print /d:COM1 'file path'
Now my question: as it is, ESC/pos printer needs to print the ESC/pos commands like a paper cut, barcode printing, etc. When I paste the ESC/pos commands in the .txt file, it is print as it is, not as ESC/pos commands.
I am trying to print The following ESC/pos commands:
\x1B\x40
\x1D(k\x0d\x00\x30\x50\x30TEST PRINT
\x1D(k\x03\x00\x30\x51\x
But while printing it is printing it looks like above, not as ESC commands.
How do I print ESC/pos commands using a .txt file?
There are no commands built into Windows by default, so the following options are possible.
Use the tools distributed by EPSON
Send Data Tool
Issuing Receipts with Barcodes
Use a free tool published by someone somewhere
Create your own with a script tool such as PowerShell
about_Special_Characters
Make your own with C++/C#/VB etc.
Regex.Unescape(String) Method
Regular Expression Language - Quick Reference
Create a file with binary data instead of text and copy it to COM1 with the copy /b command

Ghostscript command to finish a print job in interactive mode?

I am trying to build a shell service that prints PDF documents using Ghostscript running under Windows. The service should run a simple command via stdin with the filename of a PDF document and use the same printer and its settings as a context.
By default, Ghostscript starts in interactive mode. The idea is to use the same Ghostscript process rather than to run gswin64c.exe on each request to the service. Only for developing and testing, the Microsoft XPS Document Writer is used to get the result in the desired XPS file, which name is selected manually. That is why I use the Ghostscript device mswinpr2. At production environment, there will be another printer.
The command to start the Ghostscript process is as follows:
gswin64c.exe -dFitPage -dNOSAFER -dNOPAUSE -q setup_xps.ps
The Ghostscript code of setup_xps.ps:
mark
/NoCancel true % don't show the cancel dialog
/OutputFile (%printer%Microsoft XPS Document Writer)
/PageSize [114.0 85.0]
(mswinpr2) finddevice % select the Windows device driver
putdeviceprops
setdevice
Such a setup is the only way to set OutputFile to %printer%Microsoft XPS Document Writer: gswin64c.exe v9.54 does not recognize it correctly when passing through the command line (as a result, mswinpr2 opens the standard print dialog to choose a printer).
Then, to print a PDF document: (test.pdf) run.
However, the print job is left in the enqueuing state after. And the showpage command just adds a blank page to the output XPS document. It is seen when updating the printer's job queue.
The question is what PostScript or Ghostscript command (or another language) should be used to finish this print job (which closes the output XPS file gracefully), leaving in the interactive mode of the running Ghostscript process to execute further print commands like (test_2.pdf) run, (test_3.pdf) run and so on.

print a file in landscape from Windows command line or powershell

I can happily print a file using get-content e.g. :
get-content .\test.txt|out-printer "epson wp-4525 series"
How can I do this in landscape?
Can't help you in powershell but on the command line it is a matter of sending the correct escape code to your printer. Most printers support the HP escape sequences to do that. See eg here for a basic list. You can either echo the characters directly to your printer, insert them in your text file or send them through separate files. In the last case you can insert the code
Esc&l1O in a file, eg landscape.prn, you will need also a code to eject the page from your printer Esc&l0H. The Esc is the Ascii 27 character, you will need to save this in an editor capable of this, in notepad you need to save the file as unicode.
Copying the whole thing to your printer goes like this for a shared USB or network printer
copy /b landscape.prn+text.txt+eject.prn \\pcname\shared_printer_name
or
copy /b landscape.prn+text.txt+eject.prn lpt1
if you use a parallel printer or redirect to lpt1
The /b is to copy in binary mode making sure all characters are passed.

Printing pdf file directly from dos command line

I am trying to print a pdf file from dos, in windows xp.
C:\>print c:\dos.pdf /D:"\\jayaprada-pc\HP LaserJet 1018"
C:\dos.pdf is currently being printed
Its saying doc is being is printed. but no print is coming my printer.
Its showing the document in printer spooler window.
When giving print normally from adobe reader , print is coming fine.
What is wrong with my config.
Actually i want to print a pdf document from command line , so it wont pop up printer properties.
Suggest me any other alternative or third party tool that can be used print from command line in windows.
Use this:
AcroRd32.exe /t <file.pdf> <printer_name> <printer_driver> <printer_port>
For example:
"C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" /t "D:\File.pdf" "Brother MFC-7820N USB Printer" "Brother MFC-7820N USB Printer" "IP_192.168.10.110"
Note: To find the printer information, right click your printer and choose properties.
In my case shown above, the printer name and driver.

How to output vt100 format text to unix socket from windows in Perl?

The text will be mis-aligned if displayed in windows prompt directly.
Is there a module for converting vt100 format so that it can display normally in windows?
UPDATE
Environment:
client: telnet from windows prompt
server: unix

Resources