Printing without print confirmation dialog.

User Help for Seamonkey and Mozilla Suite
Posts: 1
Joined: January 28th, 2004, 1:25 pm

Post Posted January 28th, 2004, 1:38 pm

After searching for a solution for printing using the javascript print(); command WITHOUT creating a print dialog box I finally found a solution. I couldn't find any information online, so I thought I would put it here for the next guy.

We are creating an application using LINUX/MySQL/PHP/Apache. The application runs on a dedicated box and is used by customers. We have successfully removed all of the dialog boxes, but the print dialog box kept popping up every time the user hit our javascript window.print() button. This created a probelm of professionalism in the interface. After much searching, we discovered that the talented team at has already solved this problem, but there were no instructions on how to make it work.

All you need to do, is set a preference up on the CLIENT BROWSER, you can't do this through the web, you must have direct access to the local browser. If people could do this through the web, every porn popup in the world would come streaming through the printer.

Go to about:config (Type this in the address bar)

Right click on any preference and select "NEW" > "BOOLEAN" IMPORTANT: DO NOT SELECT STRING or NUMERIC as this will not work if you are an idiot (like me) and select "STRING"

type: print.always_print_silent

Hit OK

type: true

Restart the browser. This writes a line to the prefs.js file (on windows) (or the user.js file on Linux?) the next time you start the browser, any javascript print(); command will print directly to the printer using the currently configured print settings. The exact syntax is:

<a href="#" OnClick="window.print();">PRINT THIS WINDOW</a>

I hope that this helps someone else, as we had much trouble tracking this down. The following are key words to help the next guy find this:

mozilla silent printing
silent print
javascript print without dialog mozilla
printing without dialog box


Post Posted January 19th, 2010, 4:21 am



Post Posted June 6th, 2010, 8:10 am

Thank you for sharing. Excelent Job


User avatar
Posts: 39759
Joined: October 18th, 2007, 1:45 pm
Location: Next door to the west

Post Posted June 6th, 2010, 12:58 pm

You are replying to an elderly thread. Locking so that the solution does not get hidden by the thanks ports..
Post wrangler
"Given this sequence of events, the argument is like the thirteenth chime of a clock: you not only know it's wrong, but it causes you to wonder about everything you heard before. "

Return to SeaMonkey Support

Who is online

Users browsing this forum: No registered users and 1 guest