From 9ba3cb3e9b426b72b14e6c616fdb35828e4b9f7c Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Sat, 1 Jun 2019 00:17:19 +0530 Subject: Update plugins, add mutool to view PDF --- plugins/pdfview | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'plugins/pdfview') 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 -- cgit v1.2.3-70-g09d2