Change default PDF application under ubuntu 8.10/Firefox 3.0


Zotero does always use evince when I double click on a pdf to open it. I changed the default action for pdfs to xournal and set "do not ask again" but evince is called anyway.

Any idea where zotero stores the default application for opening a pdf?

  • Do you mean you set the Firefox settings or the OS settings? Set the other one.

    (For files not handled natively by Firefox or by a plugin, Zotero generally just launches the file via the OS. Some OSes don't support this kind of launching, however, in which case Zotero just loads the file via Firefox's external helper app window, which you can configure in the Firefox prefs. At one point Firefox on Linux didn't support launch() and used the helper app window—I'm not sure if this is still the case.)
  • Hi,

    thanks for your fast answer. The strange thing is that I set both to use xournal, but Zatero is still using evince (the former default viewer).

    I forgot to mention that I use the 64Bit version of ubuntu.

    Here is the log while I tried to open a pdf (and it opened with evince):

    zotero(5): SELECT linkMode, path FROM itemAttachments WHERE itemID=4070

    LoadPlugin: failed to initialize shared library /home/mlesniak/.mozilla/plugins/ [/home/mlesniak/.mozilla/plugins/ wrong ELF class: ELFCLASS32]
    LoadPlugin: failed to initialize shared library /home/mlesniak/opt/helix/mozilla/ [/home/mlesniak/opt/helix/mozilla/ wrong ELF class: ELFCLASS32]
    zotero(3): MIME type application/pdf cannot be handled natively

  • edited November 18, 2009
    From, it appears that Gnome doesn't respect the proper hierarchy of defaults.list files but that you can edit /usr/local/share/applications/defaults.list manually to set the default app (using /etc/gnome/defaults.list as a template for the format).

    [Edit: Updated obsolete link]
  • Hello Dan,

    thanks for this helpful information :)

    Have a nice weekend,
  • edited November 18, 2009
    This is more an aide memoire for myself, but others may find it useful.
    I was trying to get Zotero to open pdf's using Foxit.
    In the end I had to change the command of Document Viewer in
    to FoxitReader %F
    as well as changing
    to FoxitReader.desktop

    oh and Dan's link is wrong:
    does work
  • I just played around with trying this with PDFXchange (running under wine) under linux mint 11 (gnome 2) for a while and got it working.

    First, make sure PDFXchange is your default pdf viewing software. This works in mint 11 by just right clicking 'open as... other' on a pdf and keeping the 'remember this selection for files of this type'.

    The problem is that zotero standalone won't notice that, it keeps using the default from your gnome.list. So...

    1. Clone a desktop entry for pdfxchange at /usr/share/applications/pdfxchange.desktop

    Mine looks like this (without the dashes):

    [Desktop Entry]
    Comment=Read and Annotate PDF Document
    Exec=xdg-open %F
    Comment[zh_CN]=Read PDF Document
    GenericName[zh_CN]=PDFXchange PDF Reader

    save that file, then modify /etc/gnome/defaults.list:application/pdf to pdfxchange.desktop
  • saulalbert,

    What you're describing is exactly what I'm trying to achieve also. I've got PDFXchange installed and set up as the system default (open as . . . . other). I'm also okay with editing defaults.list, but still being rather new to Linux (Ubuntu Natty), I'm a bit lost on "1. Clone a desktop entry for pdfxchange at /usr/share/applications/pdfxchange.desktop . . ."

    Might you be able to spell out this part of the process just a bit further?

    Thanks so much.
  • I believe all he means is to create that file at that location (using a simple text editor) - you may have to do this with sudo privileges, i.e. start with
    sudo gedit /usr/share/applications/pdfxchange.desktop
    (obviously replace gedit with vi, vim, emacs or whatever you like to use)
    copy the content between the --- above, save and done.
  • Okay, yes, adamsmith. That does it perfectly. Though, when I'd tried this earlier, I'd assumed that "[Desktop Entry]" was an unessential comment. Having added this line to the file, everything works great. Thanks so much, folks.
  • edited March 2, 2012
    in case you're curious - the last two lines
    Comment[zh_CN]=Read PDF Document
    GenericName[zh_CN]=PDFXchange PDF Reader
    are unnecessary and won't do anything unless you're on a Chines version of Ubuntu ;-) - they localize the text displayed
  • Heh. I had suspected those comments were inessential but hadn't noticed the Chinese notation. ;-) Thanks, again.
Sign In or Register to comment.