Printing without print confirmation dialog.

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

Printing without print confirmation dialog.

Post by oojoshua »

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 Mozilla.org 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
always_print_silent
javascript print without dialog mozilla
print.always_print_silent
printing without dialog box
Bananier
Guest

Re: Printing without print confirmation dialog.

Post by Bananier »

THANKS !!!
Whoknows99
Guest

Re: Printing without print confirmation dialog.

Post by Whoknows99 »

Thank you for sharing. Excelent Job
User avatar
LoudNoise
New Member
Posts: 39900
Joined: October 18th, 2007, 1:45 pm
Location: Next door to the west

Re: Printing without print confirmation dialog.

Post by LoudNoise »

You are replying to an elderly thread. Locking so that the solution does not get hidden by the thanks ports..
Post wrangler
"Choose between the Food Select Feature or other Functions. If no food or function is chosen, Toast is the default."
Locked