All pastes #461505 Raw Edit

hengha

public text v1 · immutable
#461505 ·published 2007-04-27 18:36 UTC
rendered paste body
;; covert pdf to text then read it in console
(cond ( not window-system )
(add-to-list 'auto-mode-alist '("\\.pdf\\'" . no-pdf))
    (defun no-pdf ()
      "Run pdftotext on the entire buffer."
      (interactive)
      (let ((modified (buffer-modified-p)))
        (erase-buffer)
        (shell-command
         (concat "pdftotext " (buffer-file-name) " -")
         (current-buffer)
         t)
        (set-buffer-modified-p modified)))
)