aboutsummaryrefslogtreecommitdiff
path: root/ennum-html.el
diff options
context:
space:
mode:
Diffstat (limited to 'ennum-html.el')
-rw-r--r--ennum-html.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/ennum-html.el b/ennum-html.el
index 5198a80..7e3eacb 100644
--- a/ennum-html.el
+++ b/ennum-html.el
@@ -372,6 +372,21 @@
"video"
:follow 'ennum-html-follow-video)
+(defun ennum-html-export-pdf (path desc backend)
+ (pcase backend
+ ((or 'ennum-html 'html)
+ (xmlgen
+ (let ((link-path (url-encode-url
+ (expand-file-name* path (ennum-setting :static-directory)))))
+ `(object :data ,link-path
+ :type "application/pdf"
+ :width ,(ennum-setting :pdf-width)
+ :height ,(ennum-setting :pdf-height)
+ "Download " (a :href ,link-path ,path)))))))
+
+(org-link-set-parameters
+ "pdf" :export 'ennum-html-export-pdf)
+
(defun ennum-html-export-static (path desc backend)
(pcase backend
((or 'ennum-html 'html)