fuxialexander / org-pdftools

A custom org link type for pdf-tools
GNU General Public License v3.0
335 stars 36 forks source link

Small fixes to `org-pdftools-export` #46

Closed torfjelde closed 3 years ago

torfjelde commented 4 years ago

On master we have the following behavior:

(org-pdftools-export
 "~/test.pdf::14++0.00;;annot-14-2"
 "test.pdf: Page 1"
 'html)
;; => "<a href=\"~/test.pdf#page=14\">nil</a>"

(org-pdftools-export
 "~/test.pdf::14++0.00;;annot-14-2"
 "test.pdf: Page 1"
 'latex)
;; => "\\href{~/test.pdf}{nil}"

while on this branch we have the (seemingly correct) behavior:

(org-pdftools-export
 "~/test.pdf::14++0.00;;annot-14-2"
 "test.pdf: Page 1"
 'html)
;; => "<a href=\"file:///home/tor/test.pdf#page=14\">test.pdf: Page 1</a>"

(org-pdftools-export
 "~/test.pdf::14++0.00;;annot-14-2"
 "test.pdf: Page 1"
 'latex)
;; => "\\href{file:///home/tor/test.pdf}{test.pdf: Page 1}"

This will result in links which can be opened by clicking on them in their respective viewers :+1:

MarkusPettersson98 commented 3 years ago

Can confirm, this fixes both the link name being rendered as 'nil' as well as making the link open in my pdf viewer. Great job! :+1: