Interfacing to a Brother PTouch printer? - printing

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

Related

How to generate a print data file for Honeywell mobile computer to print on a Zebra Bluetooth printer by its utility, BTPrint.exe?

I have a Honeywell Dolphin 6510 mobile computer( hand-held device with Windows Mobile 6.0 OS ).
I want to develop an application which will be run on this mobile computer. The application needs to call a Honeywell device stock command utility, BTPrint.exe, to print on a Zebra Bluetooth printer. The path and filename of a print data file will be the value of 'CommandArgs' of the command, BTPrint.
This print data file needs to include the formatting commands for the printer used.
Here is the way about Honeywell devices printing on Bluetooth printers.
https://honeywellaidc.force.com/supportppr/s/article/How-to-print-a-label-on-a-Bluetooth-printer
Is there any sample code that reads a label format file created by Zebra Designer and then generates a print data file for Zebra printer which will be used by the Honeywell print utility, BTPrint.exe?
Btw, I have tried to download and install Honeywell SDK several times in order to find some of these samples. But every time I failed in installing process. I wrote to its support email address for help, but have not gotten any reply. :-(
Thank you all in advance.
This is my finding so far:
How the Print Demo works
The Printing Demo application is controlled by exm files. To extend the list of available print samples, merge the new files and information into the exm file. The print files hold everything needed to print a demo label or receipt in the printing language understood by the printer.
copy the device file "\Honeywell\PrintDemoMenu.exm" to the PC.
Open PrintDemoMenu.exm with a Text-only editor, for example Windows Notepad, on the PC.
Insert new lines in the following form for every new print file (here csim2receipt.prn):
<Section desc="" flags="128" name="PrintCSIM2receiptBT">
<Key flags="16" name="Name">Intermec (BT,CSIM,2inch) Receipt Print</Key>
<Key flags="16" name="Description">Print 2inch Receipt to an Intermec printer in CSIM</Key>
<Key flags="16" name="CommandLine">$(InstallDir)\Power Tools\btprint.exe</Key>
<Key flags="16" name="CommandArgs">"$(InstallDir)\Demos\csim2receipt.prn"</Key>
Copy the menu exm back to the device.
Start Printer demo on device and check for the new entry.
UPDATE: see BTPrint.exe Sample with Zebra Designer
At last, I found that we can generate these print data files( .prn for Toshiba TEC portable printer ) with utility, BarTender, which is a 3rd-party tool some like Zebra Designer.
And, I actually printed out on a TEC printer with the command "BTPrint.exe \Temp\mytec.prn" running on my Honeywell mobile computer.
In fact, we also can generate a print data file for Zebra printer with utility, Zebra Designer.
For you all reference.

How to convert CorelDraw .WI wavelet-compressed image

I have a large sample of .WI images I need to convert to e.g. JPEGs, but the format now seems defunct.
The mimetype is image/wavelet.
The compression algorithm was developed by Summus, a US company that also now seems defunct.
The last CorelDraw support for the format was under 32-bit Windows. If I go down the hardware route I need to be able to make calls to a server via e.g. REST.
I think under *nix djvulibre might be able to open the files, but I haven't been able to test this yet.
Another option is to re-implement the codec myself.
It would be a nice-have to be able to script this.
Here's an example file http://www.wolfgang-rolke.de/graphics/wavelet.wi

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

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

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