Gimp default for opening PDF's from Firefox

I have been struggling with the same issue and managed to fix it by installing the PDF download pluging for Firefox. In the options of the plugin I could set it to use okular for opening pdf docs.

HTH

JK

Strange… Nobody tried to type the patch

/usr/bin/okular

on opening a pdf file??

Thanks gogga.

This issue was puzzling me no end and I have tried all the suggestions above before to no avail. installing the PDF Download plugin for firefox did the trick!

Thanks again.
MK
:slight_smile:

I got a solution that works from another forum (see here). I have copied it below:

to make pdf open using a specific application when you double click it in the FF download manager, edit /usr/share/applications/mimeinfo.cache , search for: application/pdf= . Put the name of application.desktop of the desired application right after = .

So to use okular, it should look like this:
application/pdf=kde4-okularApplication_pdf.desktop

Notice the extra kde4- , this is necessary because okularApplication_pdf.desktop is in the subfolder kde4 in /usr/share/applications.

Replace okularApplication_pdf.desktop with whatever name of the .desktop file of the app you want. If it’s in the same folder as mimeinfo.cache, i.e. /usr/share/applications then use the name of the .desktop folder, if it’s in a subfolder then prefix it with kde4- , or kde- , whatever. See if this works.

mimeinfo.cache is a dynamic file and will be changed automatically when you install/uninstall a programme (this explains what happened when you uninstalled gimp). Of course you can keep a local copy of this file maintaining your own associations across reinstalls), you need to put this copy in ~/.local/share/applications , also a copy of /usr/share/applications/defaults.list

Actually changing the file association should be done in /etc/gnome-defaults.conf… but after spending about 2 hours tweaking it, I still was unable to get it to use my settings… whenever I ran SuSEconfig --module glib2 (which should read the configs from the previously mentioned conf file), it associated the pdf with gimp…

I decided to remove the postscript and pdf mimetype entries from the /usr/share/application/gimp.desktop file, to force okular, but that resulted in not having any entry at all for pdf files…

And then I saw, that the SuSEconfig generates 2 mimetype handler files… one contains only gnome programs (/var/cache/gio-2.0/defaults.list), but also another one, which contains both gnome and kde programs (/usr/share/application/mimeinfo.cache). So I tried setting the /user/share/application/defaults.list (link pointing to /var/cache/gio-2.0/defaults.list which is used by gnome) to point to the before mentioned mimeinfo.cache… and that indeed got my problems solved…

All in all I have no clue what the heck does the SuSEconfig screw up, and why on earth does it generate two separate “default” mime files, but this seems to have solved my problems with FF and gimp.

I’m a visitor from the Debian world, where I had the same problem. I eventually found a solution: Firefox wants the full path to the app to use. So I went into Preferences and, for xpdf, I chose ;Use other’. Then I navigaged to /usr/bin/xpdf and clicked on that. Now Firefox uses xpdf instead of gimp.

I had the same problem. I resolved it by editing the Firefox preferences, clicking on “use other” and following the links to /usr/bin/okular. Double clicking on this okular link placed it in the Firefox Applications action preference. It now opens okular for me when clicking on a .pdf document. Hope this helps.

I think acompbell is right. If i do anything manually, just replacing the app opening pdf’s it’s not working. If I change from FF, the full path to the app is writen and it works. Ridiculous BTW.

Have a look at
[ubuntu] HOWTO Fix GIMP associating with PDF files (bare-hand approach) - Ubuntu Forums](http://ubuntuforums.org/showthread.php?t=1130366)

It might help …

Also found in another forum: simply removing the pdf mimetype from /usr/share/applications/gimp.desktop works.

I found your discussion maybe a little bit late. But a convenient solution I created myself is as follows:
open with text editor and root rights /etc/gnome_defaults.conf
add the following line after the entry “# mime/type=xxx.desktop”:
application/pdf=acroread.desktop
save the file and run with root rights:
SuSEconfig --module glib2

viola - done!
You have to bear in mind that this will work only with acroread installed from the repositories. You have to change this in case of downloading Acrobat Reader 9 from Adobe.

Cheers, Manni

I think finally I’ve found the recipe:

There is a file called: /usr/share/applications/defaults.list

with a line:

application/pdf=gimp.desktop

just change to

application/pdf=kde4-okular.desktop

and that’s all.

Hope this helps.
Diego

interesting: the top of my /usr/share/applications/defaults.list says:
“# generated by SuSEconfig --module gnome-vfs2 from
/etc/gnome_defaults.conf” and i therefore wonder if it would actually
have any effect if i were running KDE4…

–
platinum

Works for me (on KDE4)

Thanks dercol!

Has to be repeated upon certain (as yet unknown) upgrades.

Thanks Diego, and I found for Opera:
linux-pb1x:/usr/share/applications # grep “gimp” * |grep “pdf”
mimeinfo.cache:application/pdf=gimp.desktop;kde4-okularApplication_pdf.desktop;

so I took “gimp.desktop;” out.

I was having the same problem with Gimp opening on pdf’s in Firefox and I just “fixed” it by following a suggestion here. In the open dialog, I picked “other” and then pointed to user>bin>okular. No more Gimp for pdfs here. Thanks much!

still relevant for opera 11.61 for opensuse 12.1 :smiley:

I was having a similar problem with Zotero standalone, which I believe is based on the Firefox plugin architecture in some way. Although firefox and dolphin both opened PDFs with my viewer of choice (PDFXChange), Zotero kept opening it with GIMP. Changing the defaults.list to PDFXChange Viewer has it working now.

that worked for me

Firefox has its own file under each profile.
Rename the file (i.e., mv MimeTypes.rdf MimeTypes.rdf.backup-$(date +%Y%m%d-%H%M)) and restart Firefox.
NOTE: You’ll have to reset all mimetypes again, but you have the original as a backup.

If KDE, check out Personal Setting.
Or for ALL, open your file browser and right-click and select “open with other application”.
The dialog that opens also gives the user an option to make it the default.
This is probably how Gimp became the default. Easily changeable.

http://kb.mozillazine.org/MimeTypes.rdf