Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I regularly annotate pdf files and unfortunately there is no good linux pdf reader that supports decent annotations. Evince has a very rudimentary and buggy annotation feature. So I'm stuck using a Windows viewer through wine.

This works pretty well but, when I simply right-click a file (in this case a pdf), properties, open with and selected Foxit Reader, the Unity Launcher icon remained the wine icon instead of the application icon.

Has anyone set a wine program as the default program for any file?

Any ideas?

share|improve this question
4  
Foxit Reader has Ubuntu package. You don't need to run it under Wine, unless you want to –  zetah Jan 12 '12 at 15:05
    
Found this page which explains how to do this: help.ubuntu.com/community/Wine but I'm stuck at the last step: 11.10 doesn't permit me to set a custom command as the default application. –  To Do Jan 14 '12 at 14:23
add comment

3 Answers

up vote 4 down vote accepted

I solved the problem myself. Here's how:

Step 1: Create script

I followed the procedure in the https://help.ubuntu.com/community/Wine page:

gedit ~/.wine/Foxit5

Now paste the following script in it, save and close gedit. If you changed the installation path, modify the 2nd line accordingly.


#!/bin/sh

QUICKPARLOCATION="c:\\Program Files\\Foxit Software\\Foxit Reader\\Foxit Reader.exe"
PARAM=`winepath -w "$*"`
wine "$QUICKPARLOCATION" "$PARAM"
exit 0

Make sure the file is executable with this command.

chmod +x ~/.wine/Foxit5

Step 2: Create .desktop file

Info from this site: http://ubuntuforums.org/showthread.php?t=1863021

  1. cd to the directory /usr/share/applications
  2. use 'grep -i foxit *' this will search for the name foxit ignoring case.
  3. if it's not there make one from one of the smaller ones.
  4. I used sol.destop and copied it to my own fake app.
  5. Don't forget the %f, this shows that the application can be passed a file name, it has to be there to show up in the list.

    sudo cp sol.desktop foxit.destop

    gksudo gedit foxit.desktop

foxit.desktop Code: (I created an icon and saved it in the .icons folder)

[Desktop Entry]
Name=Foxit Reader 5
Comment=Read and annotate pdf files
Exec=~/.wine/Foxit5 %f
Icon=~/.icons/Foxit.png
Terminal=false
Type=Application
Categories=Office;
X-GNOME-Bugzilla-Bugzilla=Foxit
X-GNOME-Bugzilla-Product=foxit reader
X-GNOME-Bugzilla-Component=Zwischenlager
X-GNOME-Bugzilla-Version=3.2.1
StartupNotify=true
X-HildonDesk-ShowInToolbar=true
X-Osso-Service=org.gnome.Games.AisleRiot
X-Osso-Type=application/x-executable
X-Ubuntu-Gettext-Domain=aisleriot

Step 3: Set as default

Open file manager and find any pdf file. Click properties. Open with. Show all. Choose Foxit Reader

That's it! Well sort of… This method works only if Foxit reader 4 is not running. If it is a "file not found" error pops up.

EDIT: This methods works fully with Foxit Reader 5 but you would need to install wine 1.5 for this version to work. Visit http://www.winehq.org/download/ubuntu to do so.

share|improve this answer
add comment

I would do what zetah says:

go to:

http://www.foxitsoftware.com/downloads/

In the drop down select:

Desktop Linux

In the pop-up dialog box select package type:

deb

Then you can install the .deb file

sudo dpkg -i FoxitReader_1.1.0_i386.deb

Being honest though I have found the built-in PDF reader to meet all my expectations and have not needed Foxit on the Ubuntu side of things. I do use Foxit on my Windows VM though.

If you need advanced features like Annotations and Hilighting you can use:

[Okular][3] or even Inkscape

share|improve this answer
2  
A caveat is that the Linux version may not be as "up to date" as the Windows version: foxitsoftware.com/pdf/desklinux/download.html indicates 08/13/09. –  user25656 Jan 12 '12 at 17:37
    
The Linux version doesn't support annotations. That's the reason I use the Windows version. –  To Do Jan 14 '12 at 14:07
    
Inkscape is not capable of annotations. You may import one page from a pdf to convert it to an svg file. –  To Do Dec 4 '12 at 15:49
    
Okular doesn't save annotations in the pdf file. They are stored in the configuration folder. So annotating a file and sharing with someone else is not that easy. –  To Do Dec 4 '12 at 15:50
add comment

I'd suggest you to take a look in 2 related answers on how setting default applications: this one and this another one.

Note that it should not be necessary to run Foxit Reader via Wine, as there is a Ubuntu package for it already.

share|improve this answer
    
Those methods work well with non-wine programs only it seems. –  To Do Jan 14 '12 at 14:08
    
@ToDo Your answer is very comprehensive... mark it as the right one. Looking at it, I think it'd be better to provide the real example on your script for QUICKPARLOCATION on step 1. –  Alexandre Jan 14 '12 at 18:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.