views:

98

answers:

4

I need help trying to get thermal shipping label data from a Web site to a local Zebra printer. The data itself is just plain text but spooling it from a Web site seems to be very difficult for some reason. Does anyone have any experience with this? I am using ColdFusion 8 and Windows Server 2008.

A: 

I fiddled about with this problem for ages. In the end I had to create downloadable printfiles. The user downloads them and then copy (MSDOS) them to the printer.

There were two main issues:

  • generally speaking, you can't print from a website unless you open the file (ie the file becomes local)
  • the print drivers on the user's (Windows) machine add non-printing characters to the barcode file as it is sent to the printer

We installed a batch file (which runs copy instead of print) on all client machines that need to print barcodes and we added a right-click menu item to run the batch on files named *.barcode.

I'll be watching this thread to see if anyone has found a more direct solution. But this was the only thing we could do given the parameters of our situation.

dnagirl
+1  A: 

I was unclear by your question as if the Zebra printer is connected to the web server and what software the server is running. If you are trying to send the data to a printer connected to the web server, I used the following information to send label data to a Zebra thermal printer in an Intranet solution and it worked great:

How to send raw data to a printer by using Visual C# .NET

Perhaps you can adapt this solution to your environment.

DaveB
The Zebra printer is not connected directly to the Web server, it will be connected to the client making the connection. Or more directly it will be my customer with their Web browser.
Dave Cordes
This is one of the problems we have too.
dnagirl
+1  A: 
  • Your print data could be sent with a MIME type (there probably is one for it, but you could make one up too)
  • On the client's PC, they could have that MIME type mapped to a program that simply prints whatever it receives.

Setting the MIME type on a PC can be done with code or a .REG file. If you control the user's environment, that's pretty simple. Making a program that dumps whatever it receives is also easy. That would be a nice task for Visual C or good, old VB6. Very little code. As long as the user has the .EXE and the .REG file, they'll print reliably, every time, without the browser's crap getting in the way. (think of this as what happens when you click a link to a PDF - Acrobat opens. Well, have the little printing EXE open for your file type - easy).

This is familiar to me... I think I did this with a proprietary font set... AH! Yes, I had to do this to generate mortgage documents that used proprietary fonts for drawing the pretty lines. I was able to take a proprietary, stand-alone mortgage origination server, share the folder where the mortgage .PRN files had been created. A Web server with access to that share enumerate the files in the share to a Web page, then, when users clicked on a file, the .PRN would stream to their PCs where a corresponding .EXE would see it as one of its own and send it to the correct output device (a designated printer at their location). That dumb little piece of code eliminated 126 document servers (and their maintenance and licensing costs) instantly and mortgage documents were never lost or sent to the wrong branch by mistake again. I think it took 3 hours to get it all working from inception to testing at the branches.

Yeah, same thing here. It'll work. Trust me. It'll work.

inked
A: 

I don't know if I have fully understood your problem or the exact environment but I have answered a similar question here with an example for ASP.NET (C#). That solution is mainly for a known printer (specific IP and port). If you have several clients with their own label printers the solution could be used for that as well. But then you have to make a solution where the clients are able to set their own IP and port of their label printer. They also might need to make a port forward for the traffic in their firewall. The webpage then just prints to the specified IP and port. You can also use a domain name instead of IP.

Octadrone