Window.print () - without opening the print window

Possible Duplicate:
Silent Printing in a Web Application

I need a command window.print()to print directly without opening the print window:

enter image description here

Is it possible?

+5
source share
2 answers

try

For Mozilla: http://forums.mozillazine.org/viewtopic.php?t=48336

When you use JavaScript window.print()to print a web page in IE, by default it requests an IE printer dialog box. To avoid this, use the following JavaScript code:

if (navigator.appName == "Microsoft Internet Explorer")
{
var PrintCommand = '<object ID="PrintCommandObject" WIDTH=0 HEIGHT=0
CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>';
document.body.insertAdjacentHTML('beforeEnd', PrintCommand);
PrintCommandObject.ExecWB(6, -1); PrintCommandObject.outerHTML = "";
}
else {
window.print();
}

from: http://www.devx.com/tips/Tip/30834

+6
source

, , .

Fire Fox -

: config Firefox Enter.

"" > ""

print.always_print_silent OK.

:

"Silent" -

+3

All Articles