aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/pdfview
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-06-01 00:17:19 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-06-01 00:34:07 +0530
commit9ba3cb3e9b426b72b14e6c616fdb35828e4b9f7c (patch)
treeb1382fc1bdb833299f0a2a5a606b6a212d00df3a /plugins/pdfview
parent82e7a9870504cc87efbd259b2b47733be197e266 (diff)
downloadnnn-9ba3cb3e9b426b72b14e6c616fdb35828e4b9f7c.tar.gz
Update plugins, add mutool to view PDF
Diffstat (limited to 'plugins/pdfview')
-rwxr-xr-xplugins/pdfview12
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/pdfview b/plugins/pdfview
index 20884d4..17f45e0 100755
--- a/plugins/pdfview
+++ b/plugins/pdfview
@@ -2,11 +2,23 @@
# Description: View a PDF file in pager
#
+# Notes:
+# - $PAGER must be 'less -R' or 'most'
+# - To use mutool, uncomment the relevant lines and comment the pdftotext line
+#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
if ! [ -z "$1" ]; then
if [ $(head -c 4 "$1") = "%PDF" ]; then
+ # Convert using pdftotext
pdftotext -nopgbrk -layout "$1" - | sed 's/\xe2\x80\x8b//g' | $PAGER
+
+ # Convert using mutool
+ # file=`basename "$1"`
+ # txt=/tmp/"$file".txt
+ # mutool convert -o "$txt" "$1"
+ # eval $PAGER $txt
+ # rm "$txt"
fi
fi