about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@hut.pm>2018-05-13 21:46:26 +0200
committerGitHub <noreply@github.com>2018-05-13 21:46:26 +0200
commit1f0f9dacd5f1c85dd4931bf3127a24d24758cb4a (patch)
tree8de8e9b91d0fc29346f36d54d32983b22f2cfbc0
parent50f7f364474c78ba66de99a9bd97017ad0b67017 (diff)
parent76e986452d812fbe8f18e63b5e139b818cc48a34 (diff)
downloadranger-1f0f9dacd5f1c85dd4931bf3127a24d24758cb4a.tar.gz
Merge pull request #1140 from toonn/mutool
Mutool
-rw-r--r--README.md2
-rw-r--r--doc/ranger.12
-rw-r--r--doc/ranger.pod4
-rwxr-xr-xranger/data/scope.sh3
4 files changed, 6 insertions, 5 deletions
diff --git a/README.md b/README.md
index ef644ae6..df17f731 100644
--- a/README.md
+++ b/README.md
@@ -75,7 +75,7 @@ Optional, for enhanced file previews (with `scope.sh`):
 * `highlight` or `pygmentize` for syntax highlighting of code
 * `atool`, `bsdtar` and/or `unrar` for previews of archives
 * `lynx`, `w3m` or `elinks` for previews of html pages
-* `pdftotext` for pdf previews
+* `pdftotext` or `mutool` for pdf previews
 * `transmission-show` for viewing bit-torrent information
 * `mediainfo` or `exiftool` for viewing information about media files
 * `odt2txt` for OpenDocument text files (`odt`, `ods`, `odp` and `sxw`)
diff --git a/doc/ranger.1 b/doc/ranger.1
index c48f73d9..5726307e 100644
--- a/doc/ranger.1
+++ b/doc/ranger.1
@@ -270,7 +270,7 @@ scripts by setting the option \f(CW\*(C`use_preview_script\*(C'\fR and \f(CW\*(C
 This default script is \fI\f(CI%rangerdir\fI/data/scope.sh\fR. It contains more
 documentation and calls to the programs \fIlynx\fR and \fIelinks\fR for html,
 \&\fIhighlight\fR for text/code, \fIimg2txt\fR for images, \fIatool\fR for archives,
-\&\fIpdftotext\fR for PDFs and \fImediainfo\fR for video and audio files.
+\&\fIpdftotext\fR or \fImutool\fR for PDFs and \fImediainfo\fR for video and audio files.
 .PP
 Install these programs (just the ones you need) and scope.sh will automatically
 use them.
diff --git a/doc/ranger.pod b/doc/ranger.pod
index d36db622..6eb336f0 100644
--- a/doc/ranger.pod
+++ b/doc/ranger.pod
@@ -177,7 +177,7 @@ scripts by setting the option C<use_preview_script> and C<preview_files> to true
 This default script is F<%rangerdir/data/scope.sh>. It contains more
 documentation and calls to the programs I<lynx> and I<elinks> for html,
 I<highlight> for text/code, I<img2txt> for images, I<atool> for archives,
-I<pdftotext> for PDFs and I<mediainfo> for video and audio files.
+I<pdftotext> or I<mutool> for PDFs and I<mediainfo> for video and audio files.
 
 Install these programs (just the ones you need) and scope.sh will automatically
 use them.
@@ -678,7 +678,7 @@ in ranger.
 =item automatically_count_files [bool]
 
 Should ranger count and display the number of files in each directory
-as soon as it's visible?  This gets slow with remote file sytems.  Turning it
+as soon as it's visible?  This gets slow with remote file systems.  Turning it
 off will still allow you to see the number of files after entering the
 directory.
 
diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh
index 540a910e..25251533 100755
--- a/ranger/data/scope.sh
+++ b/ranger/data/scope.sh
@@ -60,7 +60,8 @@ handle_extension() {
         # PDF
         pdf)
             # Preview as text conversion
-            pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - && exit 5
+            pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - | fmt -w ${PV_WIDTH} && exit 5
+            mutool draw -F txt -i -- "${FILE_PATH}" 1-10 | fmt -w ${PV_WIDTH} && exit 5
             exiftool "${FILE_PATH}" && exit 5
             exit 1;;
 
pre>
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30