Skip to content

Commit

Permalink
use kimim/pdf-view-pagetext to extract text from pdf page.
Browse files Browse the repository at this point in the history
  • Loading branch information
kimim committed Jun 19, 2023
1 parent fdaacf6 commit 59cdd21
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -2837,7 +2837,8 @@ emacs theme color.
(buffer-file-name))))
(kill-new
filename)
(message "Copied %s" filename)))))
(message "Copied %s" filename))))
("t" . kimim/pdf-view-pagetext))
:config
(require 'pdf-tools)
(advice-add 'enable-theme :after
Expand All @@ -2861,10 +2862,17 @@ emacs theme color.
(interactive)
(bibtex-completion-edit-notes (list (pdf-view-get-bibtex-key))))


(defun pdf-view-get-bibtex-key ()
"Get bibtex key from PDF buffer name in pdf-view mode"
(car (string-split (buffer-name) "[-\\(_\\.]+"))))
(car (string-split (buffer-name) "[-\\(_\\.]+")))

(defun kimim/pdf-view-pagetext ()
"Show pdf text in a buffer."
(interactive)
(pdf-view-mark-whole-page)
(pdf-view-kill-ring-save)
(switch-to-buffer "*pdf-view-pagetext*")
(yank)))
#+end_src

** pdf-view-store
Expand Down

0 comments on commit 59cdd21

Please sign in to comment.