tags:

views:

88

answers:

4

For an internal customer service application, I want to create a web page that displays name and address along with some other details.

Assume we have 2 printers, PLASER and PLABEL.

Is it possible using CSS, or other methods, to send the entire page to the printer when printer PLASER is selected, and only the name & address, when printer PLABEL is selected?

+2  A: 

No, it's not possible to have different CSS depending on the printer, and it's too late for any script (if it even could access the informaton) to change the page once the printer is selected.

The only way would be for the user to select the printer twice, once in the web page to select what to print, then again in the printer dialog to select the actual printer.

Guffa
I agree with @Guffa ~ Also, a web page is not a complete application, even though we can do application-like operations on data for presentation purposes. For what you want you should consider maybe doing something with a plugin (since this will be internal, that should be possible somewhere) but this will restrict you to one or a few browsers.
drachenstern
@Guffa; Thanks, I suspected as much, and you saved me a lot of trial and error time
Noah
+1  A: 

I think what Guffa says is the current state of affairs.

Ideas where to dig - no guarantee you will find something, though:

  • If you can use IE, it may be possible to target a printer with VBScript

  • You might be able to specify a document size in CSS, and somehow divert to a certain printer according to document size on Windows's end. I don't know, it could be possible by configuring the printers correctly - just as it's possible to send documents of a certain format to a certain tray automatically.

Pekka
A: 

Instead of directly printing from the browser, you could have your application produce PDF files - you can then make used of a 'watched folders' function, which prints any file that lands in the folder to a specific printer. Could be a bit tricky to set up, but seeing as it's an internal app, it may be possible. It's the only way I can think of to completely automate it cross-browser.

The flow would go something like:

  1. User requests the printable page and label page from the app
  2. App produces two PDFs and saves them to specific, separate folders
  3. Another program sees the new files, and automatically prints them to the right printer.

It could be tricky, depending on how many instances of the printers there are, because you'll need to save them at the server side, rather than anywhere on the client, to avoid the user being asked about where to save the file. If there's a location on the network available to both the application server and the printer, this might not be such a big deal.

There are plenty of server components to produce PDF files, and desktop apps to watch folders for incoming files to print them. Which of these suits you (if any), will depend on your environment. Something like this: http://www.pdfstore.com/details.asp?ProdID=703 might work for the printing side of things...

Beejamin
A: 

you could have a FLEX button that sends label printer output instead of page format but it is up to the user if they take the fork to the left or the right when the time comes but if they actually do choose the label printer then the output would already be formatted for the label printer.

Zdaxxy