window.print() - without opening the print window [duplicate]

Possible Duplicate:
“Silent” Printing in a Web Application

I'd like the window.print() command to print directly, without opening the print window:

enter image description here

Is that possible?




For Mozilla :

When you use JavaScript's window.print() to print a Web page in IE, by default, it prompts IE's 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
document.body.insertAdjacentHTML('beforeEnd', PrintCommand);
PrintCommandObject.ExecWB(6, -1); PrintCommandObject.outerHTML = "";
else {

from :


It called silent printing and you can do it on several browsers but it isn't that simple..

On Fire Fox -

Type about:config at Firefox’s location bar and hit Enter.

Right click at anywhere on the page and select New > Boolean

Enter the preference name as print.always_print_silent and click OK.

Look at the following question:

"Silent" Printing in a Web Application


Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.