This has been asked before in several places, but I keep finding the question and never a solution.
If JavaScript on a page does window.print () I want to get back a status telling either
1) accomplished (which means there was some time elapsed, just like clocking does)
or
2) failed, and possibly a reason like out-of-paper or offline

That outcome could then invoke the correct follow-on page, "Printed" or "Unable to Print"
and this would also tell the server if the message had been delivered or not, in the printer tray.

The purpose is to print out orders from a web site.

Note that at least in Firefox, the USER (of a computer) can set print_silent option
to bypass the Print Dialog and [OK] button. We are using this option.

It would be nicer and safer if they could specify what domain(s) or even what page(s) are allowed to go directly to Print. Since that option is not provided, they are told to only use Firefox for this one purpose.

Please, if all you have to tell me is about it being a security issue, save it. Thanks.

Member Avatar for LastMitch

This has been asked before in several places, but I keep finding the question and never a solution.

Yes.

Read this

http://www.htmlgoodies.com/beyond/javascript/article.php/3471121/Print-a-Web-Page-Using-JavaScript.htm

and this:

http://stackoverflow.com/questions/6484089/printing-a-page-using-javascript

If JavaScript on a page does window.print () I want to get back a status telling either
1) accomplished (which means there was some time elapsed, just like clocking does)
or
2) failed, and possibly a reason like out-of-paper or offline

You really can't. The reason is there is alot of printers out there and there's no one code that fits all printers. Each printers has it's own setting. So that's why there's no code that fits all printers/

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.