mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
13 lines
269 B
Bash
Executable file
13 lines
269 B
Bash
Executable file
#!/usr/bin/env sh
|
|
|
|
# Description: View a PDF file in pager
|
|
#
|
|
# Shell: POSIX compliant
|
|
# Author: Arun Prakash Jana
|
|
|
|
if ! [ -z "$1" ]; then
|
|
if [ $(head -c 4 "$1") = "%PDF" ]; then
|
|
pdftotext -nopgbrk -layout "$1" - | sed 's/\xe2\x80\x8b//g' | $PAGER
|
|
fi
|
|
fi
|