From 21c0e276189438ef04500697ef22ce663f650b3b Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Sat, 7 Jan 2023 16:40:58 +0100 Subject: [PATCH] Prevent DocView to produce SVG with mutool for version > 1.20 (bug#60308) * lisp/doc-view.el (doc-view-mutool-version): New variable containing the mutool version string. (doc-view-mupdf-use-svg): If the mutool version is higher than 1.20 do not use SVG output. --- lisp/doc-view.el | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 7c272f52fb3..3253387e01e 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -209,7 +209,19 @@ doc-view-pdf->png-converter-function function) :version "24.4") -(defcustom doc-view-mupdf-use-svg (image-type-available-p 'svg) +(defvar doc-view-mutool-version + (let ((mutool (executable-find "mutool"))) + (if mutool + (with-temp-buffer + (call-process mutool nil t nil "-v") + (goto-char (point-min)) + (re-search-forward "^mutool version \\([^ ]+\\)\n") + (match-string 1)) + ""))) + +(defcustom doc-view-mupdf-use-svg (and (image-type-available-p 'svg) + (string-version-lessp doc-view-mutool-version + "1.20")) "Whether to use svg images for PDF files." :type 'boolean :version "29.1") -- 2.39.0