mirror of
https://github.com/logseq/logseq.git
synced 2026-05-02 01:46:35 +00:00
improve(pdf): display pdf meta info
This commit is contained in:
@@ -80,6 +80,21 @@
|
||||
|
||||
(set! (.-currentScale viewer) new-scale)))))
|
||||
|
||||
(defn get-meta-data$
|
||||
[^js viewer]
|
||||
(when-let [^js doc (and viewer (.-pdfDocument viewer))]
|
||||
(p/create
|
||||
(fn [resolve]
|
||||
(p/catch
|
||||
(p/then (.getMetadata doc)
|
||||
(fn [^js r]
|
||||
(js/console.debug "[metadata] " r)
|
||||
(when-let [^js info (and r (.-info r))]
|
||||
(resolve (bean/->clj info)))))
|
||||
(fn [e]
|
||||
(resolve nil)
|
||||
(js/console.error e)))))))
|
||||
|
||||
(defn clear-all-selection
|
||||
[]
|
||||
(.removeAllRanges (js/window.getSelection)))
|
||||
|
||||
Reference in New Issue
Block a user