extract_pdf_annotations_to_orgmode
extract_pdf_annotations_to_orgmode copied to clipboard
Extracting RepliGo PDF annotations to a Org-mode format snippet (unmaintained!)
- Extracting RepliGo PDF annotations to a Org-mode format snippet
I annotate PDF research paper files on my tablet using [[http://www.cerience.com/products/reader/android][RepliGo Reader for Android]]. Because I am managing my research papers within [[http://orgmode.org][Org-mode]] similar to [[http://tincman.wordpress.com/2011/01/04/research-paper-management-with-emacs-org-mode-and-reftex/][this description]] I want to get the PDF annotations back out from the PDF files and into my Org-mode files.
Since RepliGo stores its annotations very parser-friendly (it's text!) and Org-mode is just text, I can add something like this into Org-mode:
: #+begin_src sh :results output : ${HOME}/bin/vkextract_annotations_to_orgmode_snippet.sh Qian2008 : #+end_src
When I execute this in Org-mode (using [[http://orgmode.org/org.html#Evaluating-code-blocks][babel: C-c C-c]]) its text output gets back into Org-mode like this example demonstrates:
: #+results: : #+begin_example : ---- HIGHLIGHTS: --- : Manage Radiologic Portable Document Format (PDF) Files Using iTunes : In this article, we explain how to use the hidden function of iTunes (Apple Computer) to manage PDF documents as easily as managing music fles. : PDF : : #+end_example : : Sticky Notes: : #+begin_example : ---- NOTES: --- : This paper seems to be very relevant to my PIM study! : #+end_example
This method works with GNU Linux. Adaptations of paths and so forth are necessary in the script!
- Be aware of special characters and German umlauts
RepliGo does create «easy to extract» annotations under normal circumstances. But when you
- highlight special characters such as [[http://en.wikipedia.org/wiki/Germanic_umlaut#German_orthography][German umlauts]],
- OR add sticky notes or text information containing non-[[http://en.wikipedia.org/wiki/Ascii#ASCII_printable_characters][ASCII]] characters,
RepliGo Reader Android switches to an UTF encoding. PDF files with annotations stored as UTF can not extracted with this simple method presented here. In this case you'll notice (only) funny characters in the output of this script.
- Bonus: .emacs setup
These lines are part of my configuration. "C-c )" shows the reftex citation menu and with "j" I can insert a snippet for inserting annotations.
The rest might be helpful for your setup as well.
: ;;add a custom reftex cite format to insert links
: (reftex-set-cite-format
: '((?b . "[[bib:%l][%l.bib]]")
: (?r . "[[ref:%l][%l]]")
: (?p . "[[pdf:%l][%l.pdf]]")
: (?h . (concat "** %l - %t\n:PROPERTIES:\n:CREATED: "
: "<" (substring (format-time-string (org-time-stamp-format t t)) 1 -1) ">"
: "\n:ID: %l\n:END:\n[[bib:%l][%l.bib]]\n[[papers:%l][%l.pdf]]\n\n"))
: (?n . (concat "*** PDF Annotations: [[%l-notes.pdf][%l-notes.pdf]]\n:PROPERTIES:\n:CREATED: "
: "<" (substring (format-time-string (org-time-stamp-format t t)) 1 -1) ">"
: "\n:ID: %l-annotations\n:END:\n\n"
: "#+begin_src sh :results output\n"
: "${HOME}/bin/vkextract_annotations_to_orgmode_snippet.sh %l\n"
: "#+end_src\n\n"))
: ))))
:
: ;; define shortcut for inserting references:
: (define-key org-mode-map (kbd "C-c )") 'reftex-citation)
:
: ;; define my own links for e.g. "[[pdf:Voit2012]]" -> "~/archive/papers_from_web/Voit2012.pdf"
: (setq org-link-abbrev-alist
: '(
: ("bib" . "~/archive/papers_from_web/references.bib::%s")
: ("ref" . "~/share/all/org-mode/references.org::/%s/")
: ("pdf" . "~/archive/papers_from_web/%s.pdf")
: ("notes" . "~/archive/papers_from_web/%s-notes.pdf")
: ))
- License
This documentation is licensed under a [[http://creativecommons.org/licenses/by-nc-sa/3.0/][Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License]].
The script file is licenced under [[http://www.gnu.org/copyleft/gpl.html][GPL v3 or newer]].
- Example
This is an example entry of one paper in my «references.org» file:
** DONE Voit2011 - TagTree: storing and Re-Finding Files Using Tags :prioritized:to_read: CLOSED: [2011-11-20 Sun 23:19] :PROPERTIES: :CREATED: <2011-11-20 Sun 23:19> :ID: Voit2011 :END: [[bib:Voit2011][Voit2011.bib]] [[pdf:Voit2011][Voit2011.pdf]]
ISBN-13: 978-3-642-25363-8 ISBN-10: 3-642-25363-6 http://www.meduni-graz.at/imi/usab2011/ 24-26 Nov 2011, Graz, Austria http://www.springerlink.com/content/978-3-642-25363-8
- acceptance rate USAB2011: 18%
- this paper got recommended by [[contact:John Smith][John Smith]] on CHI2012
*** PDF Annotations: [[notes:Voit2011][Voit2011-notes.pdf]] :PROPERTIES: :CREATED: <2012-03-19 Mon 20:36> :ID: Voit2011-notes :END:
#+begin_src sh :results output ${HOME}/bin/vkextract_annotations_to_orgmode_snippet.sh Voit2011 #+end_src
#+RESULTS: #+begin_example ---- HIGHLIGHTS: --- navigation through folder hierarchies is still the dominant mode of information access strict hierarchy of folders This paper describes TagTree, a new concept for storing and retrieving files and folders using tagging and automatically maintained navigational hierarchies. compatible with all currently prevalent software implementation called tagstore provides a flexible framework for experimentation and a testbed for both usability studies and longer term field tests. [...] #+end_example
Annotations: #+begin_example ---- Annotations: --- this paper seems relevant to me the authors seem to have achieved clever system integration #+end_example
- Alternatives
Matt published [[http://matt.hackinghistory.ca/2015/11/11/note-taking-with-pdf-tools/][a very similar method on his blog]]. You might as well check it out.