PDF Annotation Related Tools

Posted by:

PDF Tools

After a long search (see session below), I came across this tool for PDF annotation. PDF Tools is a DocView replacement for pdf on steroids. It renders pdf files in memory on demand, thus allows much extended capabilities, such as annotation, search and lots more just like another org file. See it in action here or my screen cast.

Installation

  1. Install pdf-tools from pinguim06 branch, use official git for newer version (11/29/2016-04:15:04 PM).

    let-list-1.0.1 is needed for Arch Linux in my case. Download let-alist-1.0.1 from bottom of this link, and install it via M-x package-install-file.

    make produced the ELP file pdf-tools-${VERSION}.tar. This package contains all the necessary files for Emacs and may be installed by either using

    or executing the following Emacs command:

    NB: rebuild and re-intstall if pdf-tools stopped working after poppler update

  2. pdf-tools-org

    pdf-tools-org is an emacs package that provides integration between pdf-tools and org-mode. The main features are importing and exporting pdf annotations from/to org files.

  3. Modified annotation export function to include the link back to pdf.

    save the annotation as org file when pdf file is saved.

    pdf-tools.gif

  4. Export pdf outline as org-headings and extracting images of square annotations and inlining them. see code myrjola. Not all pdfs have outlines.

  5. Note Taking with PDF-Tools

    yet another resource.

  6. vitual PDFs

    from here.

    1. Enable recognition of *.vpdf files via M-x pdf-virtual-global-mode.
    2. Open a PDF in a directory with many more PDF files.
    3. M-x pdf-virtual-create-buffer
    4. C-c C-c

      This would create a virtual PDF representing all (complete) pages of all documents in the directory. And for the most part it acts just like any other PDF document, with the exception that the document is read-only, i.e. no modification of annotations. The file-format is explained in the buffer.

      This would be even more fun, if we could display multiple pages (e.g. snippets of multiple math-definitions, which you can’t seem to remember) per window.

Some keybindings

Navigation  
Scroll Up / Down by page-full space / backspace
Scroll Up / Down by line C-n / C-b
Scroll Right / Left C-f / C-b
Top of Page / Bottom of Page < / >
Next Page / Previous Page n / p
First Page / Last Page M-< / M->
Incremental Search Forward / Backward C-s / C-r
Occur (list all lines containing a phrase) M-s o
Jump to Occur Line RETURN
Pick a Link and Jump F
Incremental Search in Links f
History Back / Forwards B / F
Display Outline o
Jump to Section from Outline RETURN
Jump to Page M-g g
Display  
Zoom in / Zoom out + / –
Fit Height / Fit Width / Fit Page H / W / P
Trim margins (set slice to bounding box) s b
Reset margins s r
Reset Zoom 0
Annotations  
List Annotations C-c C-a l
Jump to Annotations from List SPACE
Mark Annotation for Deletion d
Delete Marked Annotations x
Unmark Annotations u
Close Annotation List q
Add and edit annotations via Mouse selection and left-click context menu
Syncing with Auctex  
jump to PDF location from source C-c C-g
jump source location from PDF C-mouse-1
Miscellaneous  
Refresh File (e.g., after recompiling source) g
Print File C-c C-p

PDF-extract

Original resource from here. This tool is a little gem which is useful to get a list of BibTeX references from a scholarly PDF article.

  1. install ruby if not already

    and, Before you use RubyGems, you should add $(ruby -e “print Gem.user_dir”)/bin to your $PATH. You can do this by adding the following line to ~/.bashrc:

  2. install pdf-extract

    NB:get the cloned pdf-extract (not the same as zip) for extract-bib option; gem install pdf-extract does NOT have it, otherwise will getting following error.

    if you met this error.

  3. Usage

    Extract references and a title from a PDF:

    Resolve references to DOIs and output related metadata as BibTeX:

    Enjoy and abuse it…

Extract annotation from PDF -my old notes

  1. updated doppler together with dependency
  2. method 1: Install leela from github or arch AUR site Note: man page not updated as in github, leela annots [NOT annotations]
  3. Method 2: Zotero, Mendeley, a tablet, et al. download C code and Makefile (papers/books/tmp/folder), make, run

  4. Method 1 with R retrieve lost of information needed to use xslt to format the data, xml attribute
  5. both method one page short, guess it is doppler thing, Method 2 do not tell whether it is highlights or links (does show the pages), method 1 DOES well.
4

Comments

  1. windrg  September 26, 2017

    Hi,
    Thanks for your brilliant article. By the way, could I have a look at your emacs config file, please?
    That would be very helpful for me to use these pdf tools like as you do.
    Thanks in advance.

    reply
    • mistan  October 5, 2017

      Here it is. Please let me know if you need any help.

      (package-initialize t)
      (package-activate ‘pdf-tools)
      (pdf-tools-install)
      ;;(add-hook ‘pdf-tools-enabled-hook ‘pdf-view-midnight-minor-mode)
      (eval-after-load ‘org ‘(require ‘org-pdfview))
      (add-to-list ‘org-file-apps ‘(“\\.pdf\\'” . org-pdfview-open))
      (add-to-list ‘org-file-apps ‘(“\\.pdf::\\([[:digit:]]+\\)\\'” . org-pdfview-open))

      (eval-after-load ‘pdf-view
      ‘(define-key pdf-view-mode-map (kbd “M-h”) ‘pdf-annot-add-highlight-markup-annotation))
      (eval-after-load ‘pdf-view
      ‘(define-key pdf-view-mode-map (kbd ““) ‘pdf-annot-add-highlight-markup-annotation))

      ;;importing and exporting pdf annotations from/to org files.
      ;;https://github.com/pinguim06/pdf-tools-borg
      (add-to-list ‘load-path “/home/tan/config/emacs/extend/pdf-tools-org/”)
      (require ‘pdf-tools-org)
      ;;auto save org when pdf file closed
      (add-hook ‘after-save-hook
      (lambda ()
      (when (eq major-mode ‘pdf-view-mode) (pdf-tools-org-export-to-org-mod))))
      ;;print pdf
      ;;(setq pdf-misc-print-programm-args ())
      (setq pdf-misc-print-programm "/usr/bin/lpr")< (package-initialize t) (package-activate 'pdf-tools) (pdf-tools-install) ;;(add-hook 'pdf-tools-enabled-hook 'pdf-view-midnight-minor-mode) (eval-after-load 'org '(require 'org-pdfview)) (add-to-list 'org-file-apps '("\\.pdf\\'" . org-pdfview-open)) (add-to-list 'org-file-apps '("\\.pdf::\\([[:digit:]]+\\)\\'" . org-pdfview-open)) (eval-after-load 'pdf-view '(define-key pdf-view-mode-map (kbd "M-h") 'pdf-annot-add-highlight-markup-annotation)) (eval-after-load 'pdf-view '(define-key pdf-view-mode-map (kbd "") 'pdf-annot-add-highlight-markup-annotation))

      ;;importing and exporting pdf annotations from/to org files.
      ;;https://github.com/pinguim06/pdf-tools-borg
      (add-to-list 'load-path "/home/tan/config/emacs/extend/pdf-tools-org/")
      (require 'pdf-tools-org)
      ;;auto save org when pdf file closed
      (add-hook 'after-save-hook
      (lambda ()
      (when (eq major-mode 'pdf-view-mode) (pdf-tools-org-export-to-org-mod))))
      ;;print pdf
      ;;(setq pdf-misc-print-programm-args
      ())
      (setq pdf-misc-print-programm “/usr/bin/lpr”)>

      reply
      • windrg  October 9, 2017

        Many thanks to you. 😀 !!!

        reply

Add a Comment