homepage Welcome to WebmasterWorld Guest from 54.211.7.174
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / WebmasterWorld / Ecommerce
Forum Library, Charter, Moderators: buckworks

Ecommerce Forum

    
Website Backend-Have Different Functions Print To Different Printers?
olimits7




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

Hi,

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

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.

[phpfreaks.com...]

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,

olimits7

 

stajer




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

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

https://addons.mozilla.org/en-US/firefox/addon/js-print-setup

rocknbil




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

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.

Why?

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.

olimits7




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

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.

@stajer:
- 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)?

@rocknbil:
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.

[nicelabel.com...]

Thanks again!

olimits7

philbish




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

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.

olimits7




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

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?

[amazon.com...]

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!

olimits7

philbish




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

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:
[waniphere...]

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

philbish




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

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / Ecommerce
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved