How to print with PCL - printing

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

Related

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.

LPR: what is the location of the file that will be sent to the printer?

For a research project about printing nanofluids I need some more control over my Epson Stylus SX600FW.
I am sending a file to the printer using lpr test.ps, then it is in the print queue. Now I want to see the file (in pdl?) that the printer driver will send to the printer. Where is the temp storage location of this file?
Or is there any other way to obtain this file? This file should contain ESC/P-R sequences in which I want to make some changes and then send that file to the printer.
Using the URI file:/tmp/ouput.prn, and by configuring it with the (gimpprint) driver of your printer, you can obtain the output that is being sent to the printer.
This is a hexadecimal file. Using the parse-escp2 perl script from the test directory of gimp-print you can view this file in a bit more understandable format.

Conversion between EPL and ZPL

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...

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