Page 1 of 4 123 ... LastLast
Results 1 to 10 of 37

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

  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
    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

    Ok that's kind of how I understood the problem. I don't think xprint is installed by default in Ubuntu. I've only used the Ubuntu repo version and the official version from the Mozilla web site, so never had the need to complie it and I'm not sure if it's compiled with xprint enabled or disabled. I couldn't find any about:config settings for xprint, so maybe uninstalling it was the easiest route. Either way hopefully you got some use out of this and it's working for you.

  8. #8
    Join Date
    Nov 2006
    Beans
    1

    Howto apply settings system wide for all users?

    Is there a way to do this for all users on a system? I.e. is there a way to configure some files in /etc/ in order that all users will have printing via kprinter?

    Thanks,
    Johannes

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

    Re: Howto apply settings system wide for all users?

    Quote Originally Posted by johannes121 View Post
    Is there a way to do this for all users on a system? I.e. is there a way to configure some files in /etc/ in order that all users will have printing via kprinter?

    Thanks,
    Johannes
    Well, I've never tried it so I can't be sure. Editing the options in about:config only modifies the prefs.js file in your profile folder. I believe there is a global prefs.js that I assume can be edited to contain this info. I will look into it when I get home as I'm at work now (using Windows and IE...bleh).

  10. #10
    Join Date
    Apr 2006
    Location
    Green Bay, WI, USA
    Beans
    399
    Distro
    Kubuntu 8.04 Hardy Heron

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

    msak007, you rule! Thanks a lot for this how to. I wanted to setup the "print to pdf" to save webpages and stuff (rather than bookmarking everything) several weeks ago. But I soon found out that the pdf printer was only available to KDE apps. Well, this fixes that problem. Thanks.
    A computer without Microsoft is like a chocolate cake without mustard.

Page 1 of 4 123 ... 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
  •