Print TIF files with ghostscript in silent mode - printing

Is it possible to print tif files directly to a network printer without print dialog? I tried using the below code.
<?php exec('gswin32c.exe -sDEVICE=mswinpr2 -dBATCH -dNOPAUSE -sOutputFile="%printer%\\<ip_address>\Printer_name" tifFile.tif'); ?>
Please help me to handle this.

Ghostscript doesn't read TIFF files, so this isn't possible anyway, silent or not.
The mswinpr2 device, as far as I know, only works for printers which are local to the machine. This is because it uses the printer driver on the local PC, if you don't have a printer driver Ghostscript can't use it.
If you do have a printer driver then make a local printer which uses it (eg have the printer on FILE: or whatever magic is required for a network printer), and print to that.

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

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

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