tags:

views:

97

answers:

1

If you use google toolbar in your brower, you know what I am talking about. When the translator is enabled, it gives you the definition of a word when you move your mouse over the word.

I am wondering whether a similar tool exists for PDF viewers. If it doesn't exist, how hard is it to create one?

I am aware that in Adobe Reader you can right-click and do "lookup word". I don't like this approach because it will bring up a browser window every time you do a lookup.

A: 

You can build on top of any open-source PDF viewer (such as Sumatra.) You will need to add code which:

  1. detects which workd is present under the cursor
    • depending on which viewer you choose to adapt, you might be able to easily adapt code that may already exists in the viewer (which should select a word when double-clicking on it.) Note that Sumatra does not have this capability at this point.
    • be prepared to treat those cases when the document is an image or a non-OCRed scan
  2. performs the dictionary lookup (and possibly caches the result) in the background
  3. pops up the translation

Cheers, V.

vladr
thanks. I'll give it a try.
jianjun