Page 1 of 2 12 LastLast
Results 1 to 10 of 37

Thread: How To: Make Firefox / Thunderbird print to kprinter automatically in KDE / Kubuntu

Hybrid View

  1. #1
    Join Date
    Jan 2006
    Location
    msak007
    Beans
    663
    Distro
    Kubuntu 7.04 Feisty Fawn

    How To: Make Firefox / Thunderbird print to kprinter automatically in KDE / Kubuntu

    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

    Code:
    about:config
    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

    Code:
    kprinter
    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!
    Last edited by msak007; August 8th, 2006 at 05:14 PM. Reason: Updated instructions

  2. #2
    Join Date
    Jan 2006
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: How To: Make Firefox / Thunderbird print to kprinter automatically in KDE / Kubun

    I am working on setting up Firefox on Linux for my college and only recently found that the terminal needs to be able to print ... this will work very nicely (as I am have done all work to lockdown the system).

  3. #3
    Join Date
    Jan 2006
    Location
    msak007
    Beans
    663
    Distro
    Kubuntu 7.04 Feisty Fawn

    Re: How To: Make Firefox / Thunderbird print to kprinter automatically in KDE / Kubun

    Thanks for letting me know it helped you. I was starting to wonder if I was the only person who found this useful.

  4. #4

    Re: How To: Make Firefox / Thunderbird print to kprinter automatically in KDE / Kubuntu

    Thanks for the description! On my debian-box i ran into problems because firefox does also use the xprint-printers (and xprint does also offer the CUPS-printers). I solved the problem in simply removing xprint: apt-get remove --purge xprint xprint-common . Since i didn't notice any problems with other programs this to me seems the simplest way to get rid of the unwanted printers.

  5. #5
    Join Date
    Jan 2006
    Location
    msak007
    Beans
    663
    Distro
    Kubuntu 7.04 Feisty Fawn

    Re: How To: Make Firefox / Thunderbird print to kprinter automatically in KDE / Kubuntu

    I never heard of or used xprint. Are you saying that it conflicted with the instructions I gave, and that you had to remove it completely in order to get Firefox to print to kprinter?

  6. #6

    Re: How To: Make Firefox / Thunderbird print to kprinter automatically in KDE / Kubuntu

    When printing firefox (if not compiled with --disable-xprint) looks also for xprint-printers (http://xprint.mozdev.org/). So when CUPS and xprint are present you have:

    - CUPS-printers
    - xprint-printers
    - PostScript/default

    When disabling only CUPS (print.postscript.cups.enabled=false) you still have the xprint-printers, so PostScript/default is not the only printer left. Only after disabling (uninstalling was the easiest way for me, maybe there are others) xprint the only printer left is PostScript/default.
    As i mentioned i had this problem on debian, so maybe on a standard (k)ubuntu installation it isn't there (xprint normally not installed or firefox compiled with --disable-xprint?).
    Last edited by helmar; August 18th, 2006 at 03:45 PM.

  7. #7
    Join Date
    Apr 2005
    Location
    South Africa
    Beans
    27
    Distro
    Kubuntu Jaunty Jackalope (testing)

    Re: How To: Make Firefox / Thunderbird print to kprinter automatically in KDE / Kubun

    Quote Originally Posted by msak007 View Post
    Thanks for letting me know it helped you. I was starting to wonder if I was the only person who found this useful.
    Thanks so much - I have no idea why they don't use these as defaults - makes more sense.

  8. #8
    Join Date
    Dec 2006
    Beans
    7
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: How To: Make Firefox / Thunderbird print to kprinter automatically in KDE / Kubun

    Thanks for the guide!

  9. #9
    Join Date
    Sep 2006
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How To: Make Firefox / Thunderbird print to kprinter automatically in KDE / Kubun

    msak007 -
    First of all, thanks for the work. Any time we can get better integration into KDE, we all benefit. *grin*

    I only have one problem.. I'm not being asked for which printer to use, or a filename to print to. Instead, it defaults to whatever is located in Firefox's print.printer_PostScript/default.print_to_filename key. When I clear the key, it picks ~/mozilla.ps for me.

    Any ideas on what I might be missing that drives the kprinter dialogs away?

    Note: I switched over to Kubuntu from Windows about six months ago, so while I can typically take care of myself and keep myself out of trouble on the system, I don't know where to look for some of the more advanced settings. If there's anything you want to know about my setup, I can get it to you.

    Thanks in advance!

    Edit:
    A possible relevant point: Firefox's default (and only) printer is simply "default", rather than "PostScript/default". Does this matter?
    Last edited by Gaiwecoor; December 7th, 2006 at 04:59 AM. Reason: Expand

  10. #10
    Join Date
    Jan 2006
    Location
    msak007
    Beans
    663
    Distro
    Kubuntu 7.04 Feisty Fawn

    Re: How To: Make Firefox / Thunderbird print to kprinter automatically in KDE / Kubun

    Quote Originally Posted by Gaiwecoor View Post
    msak007 -
    First of all, thanks for the work. Any time we can get better integration into KDE, we all benefit. *grin*

    I only have one problem.. I'm not being asked for which printer to use, or a filename to print to. Instead, it defaults to whatever is located in Firefox's print.printer_PostScript/default.print_to_filename key. When I clear the key, it picks ~/mozilla.ps for me.

    Any ideas on what I might be missing that drives the kprinter dialogs away?
    ...
    Thanks in advance!

    Edit:
    A possible relevant point: Firefox's default (and only) printer is simply "default", rather than "PostScript/default". Does this matter?
    Gaiwecoor: Thanks, I agree about the whole KDE thing and wish there would be more work on a "Firefox KDE" package to configure some of the more common tweaks we have to do manually to make it more integrated...but I digress. Regarding the issue you're having, I don't think the name of the printer has anything to do it. The repository version of Firefox 2.0 in Edgy seems to have "default" as the printer, not "PostScript/default" like 1.5 in Dapper. I verified this on my laptop, but on my Desktop I have the Mozilla version of Firefox and the printer still shows up as "PostScript/default". But the odd thing is that even on my laptop when I check about:config, the "PostScript/default" entries were still added when I tried to print the first time to the "default" printer, and they are in bold (meaning they were user customizations and not system defaults). It seems to me you have those entries as well as you posted above.

    In about:config, check the following lines and post what their respective values are:

    print.print_command
    print.print_printer
    print.printer_PostScript/default.print_command

    Once you post those, I can compare them to mine and tell you if they need to be corrected.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •