Conversion between EPL and ZPL - printing

Is it possible to convert EPL and ZPL (thermal printer languages) to common format (it could be vector grapic file like SVG)?
It will be great if I could convert from commont format to ZPL or EPL.

If you do any amount of work with Zebra thermal printers, get a design tool. The FREE ZebraDesigner2 software will do. This way you can export your printer based on whatever printer driver you have selected (EPL/ZPL/CPCL). If you need to export code for non-Zebra printers (Sato, Datamax, Intermec) look at NiceLabel
Once you have ZebraDesigner installed and driver selected, create a new port mapped to a location on your hard drive with write privileges. Then print the label and the driver will create a txt file with the printer code.
Use the printer code in your application as needed.

Not really, but I have sent WordPad docs (not WORD or .txt) to the printer and let the print driver do the work. I think I even was able to change a plain old .txt file extension to .rtf and gotten it to print sending it to the printer (copy file to UNC share path of printer). Not sure that is exactly what you were asking but I hope it helps.
Sometimes you just gotta play with these zebras and see what they will do.

If you are using linux, you can install rastertoezpl CUPS Printer Driver, so you can print any raster image (jpg, png, bmp etc., possible non image filetypes too) via thermal transfer printer.
Quick installation guide (possible I've omitted something):
tar xzf rastertoezpl-1.0.6.tar.gz
cd rastertoezpl-1.0.6
sudo aptitude install libcupsppdc1-dev libcupsimage2-dev libcupsfilters-dev libcups2-dev cups-ppdc cups checkinstall gcc checkinstall
sudo ./configure
sudo checkinstall
press '10' (Required) -> cups, cups-ppdc, libcups2, libcupsimage2, libcupsppdc1, libcupsfilters1
Then you have to setup the printer in localhost:631/printers/
Verbose installation guide for Ubuntu (russian)
Works fine for me, now I'm looking for .ezp -> raster converter...

Related

Modify basic files used with gwbasic

I have a batch file which launches other .bas files with the help of gwbasic.
Here is the code of the batch file:
graphics
cd basic
gwbasic menut-hp/d
cd \
Then I have the possibility by typing 1 or 2 etc + ENTER to choose which program i want to run. The programs are located in the same directory as my batch file. The programs are xxx.BAS files.
The problem is:
I have a piece of software written in GWBASIC that currently is set up to just print locally to LPT1.
When I disconnect the local printer, the software (gwbasic i guess) sends automatically the things to print to the network printer.
The result is that a lot of A4 papers come out with only a few lines written.
On the local printer, the printer only printed when i exited the batch program.
On the network printer, it's like its non stop synchronizing, and not only when i exit the batch program.
I see 2 solutions:
manage to put a tempo for the printing on the network printer (to refresh every 2 minutes for example)
or try to add a line in the .BAS files, to save the text in a .txt of .pdf file, instead of printing it.. or print it in a pdf file.
I have almost no idea how gwbasic works, even after some researches.
Moreover, i haven't managed to view (and modify) the code of the .BAS files
Sorry for my bad english,
If anyone has any idea, it would help me a lot!
Thank you very much :)
Maybe later, but I enjoy scripting with BASIC and CONSOLE APP.
I recommend you run a command BAT before you BAS code to get default printer
wmic printer get name,default | find "TRUE" > Printer.txt
With this linen you get the similar response into Printer.txt
TRUE Microsoft Print to PDF
After that, in your BAS code, read them and validate printer name or discard network printer before print.
Happy coding!

How to print with PCL

I have Xerox workcenter 7120, this printer is on network. I would like to print pdf file with PCL command from Linux host. My printer support PCL.
But I don't know how can I send print job on my printer with PCL.
I have find this document how explain all PCL command pcl command xerox
PCL itself is quite complex, so it's not that easy to give simple answer to your question.
First you need to convert PDF to PCL data and then you send PCL data to printer. AFAIK, GhostScript utility can do the conversion for you.
BTW, check if your printer supports PJL and possibly direct PDF printing. That could be much easier to implement since there is no need to use PCL at all.
In general, you connect to your printer's IP address, port 9100 (default) and send series of commands (PJL and/or PCL) along with actual PDF (if your printer supports it).
Example:
%-12345X#PJL COMMENT *Start Job*
#PJL JOB NAME = "test"
#PJL ENTER LANGUAGE = PDF
... actual PDF binary contents goes here ...
%-12345X#PJL EOJ NAME = "test"
%-12345X
%-12345X - escape sequence for PJL
#PJL [something] - PJL command

Ghostscript output to file with ESC-P sequences

For a project (printing nanofluids with an Epson printer) I want to see the the code that the computer sends to the printer. I am running Ubuntu 16.04 and have an Epson Stylus SX600FW printer.
Using Ghostscript 9.18 I am trying to print a simple file test.ps and I want to obtain the output file that is being send to the printer. This file should contain some ESC/P sequences if I am right.
I tried to obtain such a file using:
gs -sDevice=epson -sOutputFile=test1output test1.ps
Whatever I try, I can't find the output file anywhere, so I doubt it is even created. Then next if I have the output file, how can I read the ESC/P sequences? Thanks in advance!
For me, that command line results in a file called 'test1output' in the current directory. If you are unable to find the file you could try specifying a complete path and file spec, or at least -sOutputFile=./test1output
As for reading the sequences, any binary editor will read the file.

Interfacing to a Brother PTouch printer?

The Brother PTouch QL series of printers have USB interfaces and are capable of printing QR codes. Here's a typical model:
http://www.ptouchdirect.com/ptouch/new_ql570.html
How can I prepare input (i.e. format) for these printers and talk to them directly from my program? I'm interested in Windows, Mac, Linux platforms. Any language, a Python library would be perfect.
I don't want to generate output (e.g. CSV) and ask the user to load that into the Brother-supplied application.
I have used the iText library for printing QR barcodes. It can generate the barcode image and put it in a PDF file, which the user can send to the printer. It is a Java based library and there is also a .NET port available.
I can't speak about Windows, but Brother traditionally has very comprehensive Linux support. Here's the driver list for the PTouch models. With these drivers in place, you can print through CUPS (via the lp or lpr commands) using whatever darn file format you find is convenient for you.
OS X also uses CUPS, so printing to it would be pretty similar as on Linux... given that you can find the correct drivers.
There is a brotherprint package, part of pypi:
https://pypi.python.org/pypi/brotherprint/0.1.1
It will supposedly handle sending sockets, but I have not tried it:
import re
'''Brother Python EscP Command Library
Description:
A collection of functions to more easily facilitate printing to the Brother QL label
printers without having to memorize the ESC/P commands. Also handles sending to sockets
for you.
'''
class BrotherPrint:
font_types = {'bitmap': 0,
'outline': 1}
def __init__(self, fsocket):
self.fsocket = fsocket
self.fonttype = self.font_types['bitmap']
see: https://github.com/fozzle/python-brotherprint/blob/master/brotherprint/brotherprint.py

Convert a text file with Embedded HP Printer Codes to PostScript

I have an application that prints by generating text files with embedded printer codes, then basically just copies the file to the printer to print. I need to take that print file and convert it to an image - just as if it was printed then scanned.
My first thought was to setup a printer with a postscript printer driver attached to a file port, and then run the result through ghostscript to create a tiff, but it isn't working.
Any ideas?
The printer codes are probably PCL. Maybe pcl-parser could serve as a start for your own tool to do this? There also seems to be a commercial product called PCLXForm.
Edit: Also investigate GhostPCL.

Resources