Closed matthew-piziak closed 5 years ago
Thanks for the report! Fixed in e1bbd113e4d878d76a635dc3eaa46904df3cdf7c
Hey, sorry, I can reproduce this on f0815e4
org-link-store-props: Wrong number of arguments: (lambda (from-org-noter) "Get link from the active pdf buffer." (let* ((path (concat org-pdftools-root-dir (file-relative-name buffer-file-name org-pdftools-root-dir))) (page (image-mode-window-get 'page nil)) (annot-id (if (pdf-view-active-region-p) (pdf-annot-get-id (funcall org-pdftools-markup-pointer-function (pdf-view-active-region t) org-pdftools-markup-pointer-color (list (cons 'opacity org-pdftools-markup-pointer-opacity)))) (if (and (not from-org-noter) (pdf-annot-getannots page)) (condition-case nil (pdf-annot-get-id (pdf-annot-read-annotation "Click the annotation that you want to link to.")) ((debug error) (message "error"))) (if (y-or-n-p "Do you want to create a free pointer annotation for the link?") (pdf-annot-get-id (funcall-interactively #'pdf-annot-add-text-annotation (pdf-util-read-image-position "Click where a new text annotation should be added ...") org-pdftools-free-pointer-icon (list ... ...))) nil)))) (height (cond ((and (boundp 'annot-id) annot-id) (nth 1 (pdf-annot-get (pdf-info-getannot annot-id path) 'edges))) (t (/ (* (or (image-mode-window-get ...) 0) (frame-char-height)) (float (cdr (pdf-view-image-size))))))) (link (concat "pdftools:" path "::" (number-to-string page) "++" (format "%.2f" height) (if annot-id (concat ";;" (symbol-name annot-id)) nil)))) link)), 0
@matthew-piziak I was not able to reproduce that. What's the version of your Emacs and Org? And what happened before that error?
Versions GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.5) of 2019-08-07 Org mode version 9.2.4 (release_9.2.4-423-ge059c1 @ /home/matt/.emacs.d/straight/build/org/)
Without org-pdftools
I get something like this instead: Stored: file:<filename>.pdf::%PDF-1.6 %
. Unfortunately the drawback there is that it does not link to a particular location, just to the file.
Could you try to change the code:
(org-link-store-props
:type "pdftools"
:link (org-pdftools-get-link)
:description desc)))
to
(org-link-store-props
:type "pdftools"
:link (org-pdftools-get-link nil)
:description desc)))
and check whether the error exist?
Strange...now I get this:
pdf-info-query: epdfinfo: Error opening /home/matt/org../log/pdfs/7Sketches.pdf:No such file or directory
The PDF in question is located at /home/matt/log/pdfs/7Sketches.pdf
. No idea why the path is mangled like that. Unfortunately the error returns no backtrace.
Ah! You need to set org-pdftools-root-dir
to /home/matt/log/pdfs
Sorry for didn't make it clear...
That works! (provided you add a trailing slash)
Thanks for the help @fuxialexander.
org-pdftools
version: d19ba8812a4534b20de48c4edbd4aab2fb989a83 Emacs version: GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.5) of 2019-08-07Backtrace: