Well I know there are a few threads out there on how to integrate Firefox into KDE and how to get Firefox to print to kprinter, but there was nothing that I could find on how to do it automatically and seamlessly (instead of selecting "PostScript/default" manually every time) and not much info on Thunderbird. So here are the steps I took to get Firefox and Thunderbird to print to kprinter automatically once you click "Print".
Firefox:
1. First, if you haven't done so, you need to print to PostScript in order for the needed entry in prefs.js to be populated. This will be done automatically the first time you print. Open any web page and go to:
File --> Print --> choose PostScript/default (it should be the default if you haven't installed any printers yet) --> click "Print"
Once you have done this and it prints, it'll add the PostScript entry you need to edit.
2. In the URL bar, type
to open the config page.
3. In the "Filter" bar, type
Code:
print.printer_PostScript/default.print_command
This should filter everything out but that line.
4. Right-click on the line, click on "Modify", and change the entry to say
then click OK. This will make Firefox print to kprinter any time you select the "PostScript/default" printer.
5. Right-click anywhere in the white space, then click on "New --> Boolean" to add a new Boolean entry. Type
Code:
print.always_print_silent
and set its value to "true". This will force Firefox to print to the default printer without prompting you. If "PostScript/default" is the only printer you have and there are no local / network printers, it works great and you can stop here. But if you installed a printer through CUPS, it complicates things as Firefox will want to use that as a default and all your prints will go there without prompting you! So even if you don't have a local printer, it's a good idea to add the following line in case you add one later.
6. Once again, right-click and choose "New --> Boolean". Type
Code:
print.postscript.cups.enabled
and set its value to "false". That will disable CUPS printing in Firefox, and it will default to the "PostScript/default" printer. And since you've changed the output of that to kprinter, you'll see a "processing" dialog for a split second when you print, after which kprinter will open up. There you can choose all your printers, including PDF, PostScript, and any CUPS installed printers .
_________________________________
Thunderbird:
The procedure for Thunderbird is exactly like it is for Firefox, but with one difference: there's no URL bar to get to about:config.*
1. Just as with Firefox, you first need to print something to PostScript in order for the entry you need to modify to be present.
2. Go to "Edit --> Preferences", click on "Advanced", then click on the "General" tab. Click on the "Config Editor..." button to open the about:config window.
3. Once the about:config window is open, follow steps 3-6 above for Firefox. This will also make Thunderbird print to kprinter automatically.
* There's an alternative way to get to about:config in Thunderbird - install the about:config extension. Go here and download the extension. Install it and restart Thunderbird. Once you've launched it again, there should be an entry for about:config in your Tools menu (Tools --> about:config). You can also customize your Toolbar and add a button for about:config.
_________________________________
Resetting everything back to default:
If you ever want to disable these options or revert back to the defaults, simply do the following. If you've already closed about:config, open it up again.
1. Find the print.printer_PostScript/default.print_command again, right-click on it, and choose "Modify". Then type the following
Code:
lpr ${MOZ_PRINTER_NAME:+-P"$MOZ_PRINTER_NAME"}
and click OK. This will revert Firefox back to its native printing system.
2. Find print.always_print_silent, right-click on it, and choose "Toggle" to set its value to "False". This will change it back to the default behavior of prompting you for a printer rather than printing automatically.
3. Find print.postscript.cups.enabled, right-click on it, and choose "Toggle" to set its value to "True". This will allow Firefox to see CUPS printers again.
Hope this helps!
Bookmarks