Printing ZPL (txt) from browser (Coldfusion scripted)
We have developed a webshop using Coldfusion. Now we are adding new functionality for printing labels over the internet.
What happens, or rather what should happen is:
- The customer logs in at the shop and selects the order for which to print the labels.
- Our Coldfusion code creates a label by use of the native ZPL language: the label is saved on the server as a plain text file with the ZPL instructions.
- Javascript is used to open the text file in 开发者_运维知识库a new window.
The problem is: Printing the text file from the browser doesn't work. Not even when I set the printing not to show any additional header and footer details. Only when I request the source code and print it, the labels are printed. I Have tested this on IE9 and FF7.
So my questions are:
- Is their a way to use Javascript to send plain text to a printer, so without any HTML mark up? I came across some Javascript code that embeds the text into HTML mark up and then using the window.print() command. This is not an option.
- Or is there a way to make the printing of plain text file from out the browser work properly?
Thank you for your attention!
If your service is limited to Windows users, you can have them install the UPS ActiveX control which will direct the ZPL code to a connected thermal printer.
UPS Thermal Printer ActiveX
Simply return the data with a MIME type of application/epl2 and the ActiveX control will take the data and send it to the thermal printer.
Note that newer Zebra printers still support EPL rendering which allows for greater printer compatibility (LP2844 + ZP450 series).
精彩评论