From 4cf79691ed00be482136a8586e534dc7ea7d573c Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Fri, 22 Aug 2008 05:35:44 +0000 Subject: [PATCH] Add feature to retrieve metadata for PDFs, currently accessible as a contextual menu item. The feature grabs relevant fragments from the document and then searches them on Google Scholar. This will only work with OCRed PDFs, so it doesn't work with JSTOR, but it should work fairly well with everything else. --- chrome/content/zotero/overlay.js | 55 ++++- chrome/content/zotero/overlay.xul | 2 + chrome/content/zotero/recognizePDF.js | 234 +++++++++++++++++++ chrome/content/zotero/xpcom/translate.js | 12 +- chrome/locale/en-US/zotero/zotero.properties | 7 +- 5 files changed, 290 insertions(+), 20 deletions(-) create mode 100644 chrome/content/zotero/recognizePDF.js diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js index 67717fa67..c15e89864 100644 --- a/chrome/content/zotero/overlay.js +++ b/chrome/content/zotero/overlay.js @@ -1482,7 +1482,8 @@ var ZoteroPane = new function() createBib: 11, loadReport: 12, sep4: 13, - reindexItem: 14 + reindexItem: 14, + recognizePDF: 15 }; var menu = document.getElementById('zotero-itemmenu'); @@ -1507,20 +1508,37 @@ var ZoteroPane = new function() hide.push(m.showInLibrary, m.sep1, m.addNote, m.attachSnapshot, m.attachLink, m.sep2, m.duplicateItem); - // If all items can be reindexed, show option + // If all items can be reindexed, or all items can be recognized, show option var items = this.getSelectedItems(); var canIndex = true; + var canRecognize = true; for (var i=0; i