]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow customising pdf-to-text parameters
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 29 Sep 2019 12:26:26 +0000 (14:26 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 29 Sep 2019 12:26:26 +0000 (14:26 +0200)
* lisp/doc-view.el (doc-view-pdf->txt): Allow customising the
parameters (bug#8519).
(doc-view-pdftotext-program-args): New variable.

etc/NEWS
lisp/doc-view.el

index f858c958317ed7312c8f41dd9731d86bc1e9ebc0..cb8b6fcac189660447fd2fd66449a010c45c3bdc 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -607,6 +607,9 @@ its functions.
 *** New commands 'doc-view-presentation' and 'doc-view-fit-window-to-page'.
 *** Added support for password-protected PDF files
 
+*** A new variable 'doc-view-pdftotext-program-args' has been added to
+allow controlling how the conversion to text is done.
+
 ** Ido
 *** New user option 'ido-big-directories' to mark directories whose
 names match certain regular expressions as big.  Ido won't attempt to
index 49d2b56b7d61d8d99972668157b499237f12e651..9d10d03628568ec6ab15366cf7c24f54e1cb1e4c 100644 (file)
   :type 'file
   :version "24.4")
 
+(defcustom doc-view-pdftotext-program-args '("-raw")
+  "Parameters to give to the pdftotext command."
+  :version "27.1"
+  :type '(repeat string))
+
 (defcustom doc-view-pdf->png-converter-function
   (if (executable-find doc-view-pdfdraw-program)
       #'doc-view-pdf->png-converter-mupdf
@@ -1132,7 +1137,8 @@ Start by converting PAGES, and then the rest."
   (or (executable-find doc-view-pdftotext-program)
       (error "You need the `pdftotext' program to convert a PDF to text"))
   (doc-view-start-process "pdf->txt" doc-view-pdftotext-program
-                          (list "-raw" pdf txt)
+                          (append doc-view-pdftotext-program-args
+                                  (list pdf txt))
                           callback))
 
 (defun doc-view-current-cache-doc-pdf ()