From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ramon Diaz-Uriarte Subject: Re: Org Mode and PDF Notes! Date: Fri, 13 Nov 2015 01:39:30 +0100 Message-ID: <871tbug2bh.fsf@gmail.com> References: <877floffyq.fsf@gmail.com> <87wptnqucw.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zx2Ox-0000vG-3E for emacs-orgmode@gnu.org; Thu, 12 Nov 2015 19:39:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zx2Os-0001ZG-9K for emacs-orgmode@gnu.org; Thu, 12 Nov 2015 19:39:39 -0500 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:33027) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zx2Os-0001ZB-33 for emacs-orgmode@gnu.org; Thu, 12 Nov 2015 19:39:34 -0500 Received: by wmec201 with SMTP id c201so58996368wme.0 for ; Thu, 12 Nov 2015 16:39:33 -0800 (PST) In-reply-to: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Matt Price Cc: Ramon Diaz-Uriarte , Org Mode On Thu, 12-11-2015, at 14:11, Matt Price wrote: >> > >> > M-: (pdf-annot-get-annots) and look at the output in the *Messages* >> > buffer. Can you see any evidence of the the text? Can you share what you >> > learned? >> >> Nope, no evidence of the text. I get things such as >> >> (((buffer . #) (page . 13) (edges >> 0.113553 0.31717 0.868657 0.361746) (type . highlight) (id . annot-13-0) >> (flags . 4) (color . "#ffff00") (contents . "") (modified 22081 45188) >> (label . "TF201") (subject . "Highlight") (opacity . 1.0) ...) >> >> >> so we get the location of the highlight (and its properties), but not the >> textual contents. And this is the case whether I make the annotation with >> EzPDF or Okular or, for that matter, with pdf-tools itself. >> >> So it seems RepliGO is actually giving you a lot more by default :-) >> >> > Try replacing > > (text (assoc-default 'subject annot)) > > with > > (text (pdf-info-gettext page (assoc-default 'edges annot))) > > > in the lambda function in pdf-annot-markups-as-org-text. This will fail on > cropped pdfs if you have added highlights using the most recent pdf-tools, > which stores negative values in the 'edges field, but I've found it works > otherwise. I'd love to hear if it works for you too. (I know you're > following the relevant bug report on the pdf-tools github repo). It works! I get the highlighted text (I have just tried with a pdf I highlighted with EzPDF, the one that, above, was giving just the location and properties). And it still does the correct thing in your pdf (the one from repligo). Awesome! Thanks. R. -- Ramon Diaz-Uriarte Department of Biochemistry, Lab B-25 Facultad de Medicina Universidad Autónoma de Madrid Arzobispo Morcillo, 4 28029 Madrid Spain Phone: +34-91-497-2412 Email: rdiaz02@gmail.com ramon.diaz@iib.uam.es http://ligarto.org/rdiaz