From b2a7050deae425738fa35fb9217c6e9bf50b9ef9 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sun, 3 Mar 2013 17:04:27 -0500 Subject: [PATCH] Fix PDF recognition --- chrome/content/zotero/recognizePDF.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/recognizePDF.js b/chrome/content/zotero/recognizePDF.js index fc35c0c137..6b3f67a14e 100644 --- a/chrome/content/zotero/recognizePDF.js +++ b/chrome/content/zotero/recognizePDF.js @@ -184,15 +184,16 @@ var Zotero_RecognizePDF = new function() { return Zotero.HTTP.promise("GET", url, {"responseType":"document"}) }) .then(function(xmlhttp) { + var doc = xmlhttp.response, + deferred = Q.defer(), + translate = new Zotero.Translate.Web(); + if(Zotero.Utilities.xpath(doc, "//form[@action='Captcha']").length) { // Hit CAPTCHA limited = true; throw new Zotero.Exception.Alert("recognizePDF.limit"); } - - var doc = xmlhttp.response, - deferred = Q.defer(), - translate = new Zotero.Translate.Web(); + translate.setTranslator("57a00950-f0d1-4b41-b6ba-44ff0fc30289"); translate.setDocument(Zotero.HTTP.wrapDocument(doc, url)); translate.setHandler("translators", function(translate, detected) {