PDF annotation under Linux with Wine and PDF-XChange Viewer

Changelog

  • 2009/04/10, added script to open files from file manager.

I’ve long wanted a program to annotate PDFs under Ubuntu, but tried many options which all fell short in some way or another. Yet periodically I check to see if a new one has appeared and it seems my wishes have come true, though not through open source software.

PDF-XChange Viewer is a Windows freeware (pro version available too) which installed flawlessly under Wine (Windows emulator) in Ubuntu. In fact I had not used Wine up to this point, and I was surprised how indeed flawless the process was: ‘sudo apt-get install wine’, ‘wine installer.exe’. Bam. It just worked. And it loaded a huge PDF without flinching.

All is not so rosy, though, as the annotations and text won’t show up completely under Ubuntu default PDF viewer. But this had happened with annotations I had made with other programs, so I guess it has to do with Ubuntu’s viewer, not PDF-XChange. Indeed things worked a bit better under Xpdf.

The most surprising part in all of this is that the freeware beats other annotation options I had tried under Windows in the old days: it has many different ways of adding text to pages, different shapes to add and different highlighting options. So I guess I’d recommend that you try it even if you run Windows.

And a quick tip: you can add shortcuts for toolbar commands (including highlighting) by clicking right in the toolbar area, clicking “Customize…”, selecting the “Commands” tab, selecting “Highlight” under “Tools” and clicking “Properties”.

(Found via this post, from someone else who grappled with the other options)


Launching with “Open with…” (NEW 2009/04/10)

To open PDF files from the file manager, put the following script somewhere, change its file permissions to “executable” and use it for the “Open with…” command (adapted from here):

#!/bin/bash  

# Then use this script as default to open PDF files

# Adapted from:
# http://sodeve.net/foxit-reader-on-ubuntu-linux-through-wine/

# Purpose: To convert Linux-style filename to Windows-style
# to pass as an argument to wine when starting PDF XChange Viewer
Filename="z:"${1//\//\\}  

#assuming you use the default installation folder for PDF
# XChange Viewer in Wine
App='eval wine "C:\Program Files\Tracker Software\PDF-XChange '
App=$App'Viewer\pdf-viewer\PDFXCview.exe" "'$Filename'"'

$App

17 Comments

  1. Geek:

    It is not working..it is not being effective in open with…….I think what I am supposed to do is to write this as a file like pdfxchangeview2.sh in /usr/bin/ and use it for open with while browsing..right? But it is not working..

  2. Francois:

    Hi “Geek”. Yes I’m using it under Ubuntu with the Nautilus file browser. I right-click on some PDF, select “Open with > Open with other application…” and I browse to select the .sh file (I called it “openpdf.sh”, but whatever suits you).

    I don’t think it’ll make a difference, but I placed it in my home directory (just make sure you have proper execution rights on the file).

    On the other hand, I haven’t been able to get the script working under PCMan File Manager, which I use nowadays.

    What I do is I launch the PDF viewer (from the Wine menu, say) and then select the file in “File > Open”. But it’s less convenient…

    Hope this helps, somehow.

  3. Charl Botha:

    Thanks for writing this up!

    I just followed your howto on Lucid Lynx (Ubuntu 10.04 on x86_64) with the PDFXChange 2.0 installer and wine1.2. Works like charm.

  4. Francois:

    Thanks for the comment Charl. Glad to see others are using it! I myself still use it a lot under Ubuntu 9.10 (also 64 bit).

  5. joon:

    Thank you very much for this script. Very helpful and works like a charm.

  6. Paulo Polito:

    Thank you for the info. Works fine in Ubuntu 10.10 64, just needs editing the $App directory structure.

  7. Francois:

    Hi Paulo, thanks for the comment; happy to see that setup is still working in newer OSes. For others who’d like to use it on Ubuntu 10.10, could you specify what changes you made?

  8. Tshann:

    Hi,
    Been using this product for years in linux – works better than anything that is possible in linux – unfortunately. I’m using it now in my Debian Squeeze distro – Crunchbang Statler. But I’ve used it in all my distro’s and it works great in all of them. I have a few business machines – use it in those rigs as well. FAR better than Adobe Pro – tiny footprint and does virtually everything that Adobe does – without being a pig. The cost of buying (if you need some of the basic features) is reasonable as well. But for most, the simple free version will suffice. AWESOME product. I only wish other essential windows software worked as well in wine.

  9. Francois:

    Hi Tshann,

    I remember having searched a lot of time (with lots of episodes of giving up to try a few months later) for a Linux-native app with solid highlighting and commenting feature. I was just happy to find anything at all (open source or not), but the free version does much more than I ever wanted for annotation, anyway.

    The only downside for me is that under Wine it loses my config upon restart, so I have this 30-second routine where I reload it and set windows right etc. I don’t use Wine for anything else… I guess at some point I’ll figure out the problem had a simple fix :)

    Thank you for passing by.

  10. Venkat:

    Hi Francois,

    I got here through google.

    Fantastic tip. Thanks for solving one of my pet peeves on Linux.

    I’m using ubuntu-10.10 x86-64 and I don’t even need the openpdf.sh script to start. I installed the Xchange viewer with shell extensions and it automatically shows up in Nautilus. Great.

  11. Francois:

    Hi Venkat. Thanks for the ‘shell extensions’ tip, I’ll have to try it. To be honest XChange Viewer is the only program I use through Wine so I never really took the time to learn about Wine in general… maybe I would’ve saved some time, actually, doing that.

  12. prosist:

    thank you very much!

  13. naught101:

    (NOTE: correction comment by naught101 below)

    Awesome, thanks for the starter script. I’m using a modification, posting here for reference:

    #!/bin/bash

    # Adapted from:
    # http://sodeve.net/foxit-reader-on-ubuntu-linux-through-wine/
    # http://www.fsavard.com/flow/20.....ge-viewer/

    # Purpose: To convert Linux-style filename to Windows-style
    # to pass as an argument to wine when starting PDF XChange Viewer
    abspath=$(readlink -f $1)
    Filename=”z:”${abspath//\//\\}

    #assuming you use the default installation folder for PDF
    # XChange Viewer in Wine
    wine ‘C:\Program Files\Tracker Software\PDF Viewer\PDFXCview.exe’ “‘$Filename'”

  14. naught101:

    Sorry, delete the last comment, here is the proper script I’m using:


    #!/bin/bash

    # Adapted from:
    # http://sodeve.net/foxit-reader-on-ubuntu-linux-through-wine/
    # http://www.fsavard.com/flow/20.....ge-viewer/

    # Purpose: To convert Linux-style filename to Windows-style
    # to pass as an argument to wine when starting PDF XChange Viewer
    abspath=$(readlink -f $1)
    Filename="z:"${abspath//\//\\}
    echo $Filename
    #assuming you use the default installation folder for PDF
    # XChange Viewer in Wine
    eval wine 'C:\\Program\ Files\\Tracker\ Software\\PDF\ Viewer\\PDFXCview.exe' "'$Filename'"

  15. Francois:

    Hi naught, thank you for posting your version.

    (I’ll leave both comments there otherwise there’s a lack of context)

  16. zenchan:

    Hi, I tried PDFXchange earlier, but now I’ve found a much nicer solution for PDF annotation on Linux Master PDF viewer http://code-industry.net/pdfeditor.php

    It’s cross-platform but I’ve only used it on debian, it also comes packaged as a .deb file or tar.gz.

    It does highlighting, sticky notes, strikethrough, etc and at least the sticky notes are also visible in evince

  17. Francois:

    Hi zenchan,

    Thanks for the link. It’s been a while actually since I had to highlight PDFs on my Linux box, nowadays I simply use Acrobat on an Android tablet, but it’s good to know there’s an option that makes your highlights readable by other PDF software. (And a native option, no Wine, that’s even better).

Leave a comment