Welcome to WebmasterWorld Guest from

Forum Moderators: buckworks

Message Too Old, No Replies

Website Backend-Have Different Functions Print To Different Printers?



6:57 pm on May 3, 2012 (gmt 0)

5+ Year Member


I'm working with my programmer on the backend of my website. I need to have the functionality where I can pre-select certain printers in the warehouse due to having different types of paper size or labels for different functions of the website which would automatically print to that shared network printer when called.

For example:

Warehouse 1:
Network Printer 1: Special 8.5x11 paper with stickers on the bottom.
Network Printer 2: Special 3x5 label paper roll.
Network Printer 3: Regular 8.5x11 paper.
Network Printer 4: Another printer for special 3x5 label paper roll.

I sent him a wireframe of an admin "pre-select printer" page where admin users could browse/select/save these different network printers from the computer so when these different functions are called the right network printer is used to automatically print.

However, he tells me that this isn't possible to catch local network printers from web applications; but this is why I sent him the admin "pre-select printer" page, I thought this would be a good work-around to this issue.

He also sent me the following link where someone discusses this same issue, but I see the responses are from 2008 so maybe there is something new out that could work.


Does anyone know if my admin "pre-select printer" page would work for this?

Or if anyone has any suggestion of how I can get this to work properly so I can automatically print to the right printer when a certain function is called through admin?

Thank you,



6:57 pm on May 4, 2012 (gmt 0)

10+ Year Member

We do what you are describing, but we had to use a Firefox plug-in called JS Print Setup.



10:25 pm on May 4, 2012 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

He's right, it can't be done with web applications in server side programming.

There **may** be a way to program a Java (not Javascript) applet or Flash object that can do this - or a plugin, which makes it browser specific.


A browser does one thing (oversimplified, but): sends requests to servers and renders the data from the response. When you go to print, it now communicates with the user's system to connect to printer and print what's rendered to the browser canvas (actually the "print" canvas, which can accept different styles from @media print {}, but same concept.) It's no longer a web page, it's a flat matrix of pixels contained within the browser memory and nothing more.

Browser security policies prevent information from crossing over the rendering space into the areas of the browser that communicate with the system. Imagine if something from the a web page could communicate with the user's system; can you see what an immense security hole that would be? This is also why you can't read a system path via a file upload object.


4:42 pm on May 6, 2012 (gmt 0)

5+ Year Member

I think this is the way my programmer is currently setting up the backend of the website for these specific processes.

After the specific process runs the website generates/creates a *.pdf file of either the "shipping label" or "packing slip" and then I have to manually open, browse to printer, select printer, and then print. So I would have to do this over-and-over, and as you can see this becomes a very tedious process.

This is why I was trying to find any way possible to automate this so each specific process automatically prints to the right printer.

- So with this Firefox add-on I would be able to select multiple printers in my LAN network and specify which process will print to what printer?
- How would the add-on know what printer needs to print for each specific process that the website runs (e.g. website process to print shipping label, website process to print packing slip)?

Thanks, that makes sense! However, it is so frustrating not being able to implement something like this easily. If my backend was software based this wouldn't even be an issue. But with so many web applications running online now, I'm surprised that a more reliable system hasn't been put into place to solve issues likes this; especially from the "warehouse operations" standpoint.

I did find this "NiceLabel SDK"; which looks like it does what I'm looking for, but it is expensive and out of my budget for now.


Thanks again!



2:52 pm on May 7, 2012 (gmt 0)

10+ Year Member

The way I print everything is like this:

Printers setup locally to a Mac Mini that acts as a print server.
PHP script running on Mac Mini that calls a simple shell script to send a file/data to a printer.
Mac Mini access accessable from the outside world, on static ip.
My remote web server hosts the backend order system, and user interface. Actions on there can trigger something to print by sending a HTTP request via cURL with the file/data to be printed, and which printer to print on.


4:36 pm on May 7, 2012 (gmt 0)

5+ Year Member

Thanks for the reply!

Ok, I'm trying to understand this better to see if I can implement something like this as well.

Would this process work for me if I purchased multiple print servers like the following and hooked each printer up within my LAN on different internal static IP addresses?


Hmmmm, but I would still need to use a WAN IP address; right? Since each printer would have it's own LAN IP address, but then how would I be able to route to the right printer within my LAN network?

Thanks again!



3:29 am on May 13, 2012 (gmt 0)

10+ Year Member

Yes you'd still need to use a WAN ip address:

Your remote web server application could invoke a http request to your wan ip, also running a web server

Could have a simple printme.php on your local web server, lamp stack, apache, whatever:

Then that printme.php could send the data to a printer as specified in the query string.

If I can clarify anything just let me know happy to help


3:32 am on May 13, 2012 (gmt 0)

10+ Year Member

Or you could also try port forwarding with your router, and not need the local webserver. And just send directly to a printer from the outside world. But I had trouble setting that up so just went with the local Mac Mini as a "print server" route.

Featured Threads

Hot Threads This Week

Hot Threads This Month