My build of nnn with minor changes
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

25 lines
613 B

  1. #!/usr/bin/env sh
  2. # Description: View a PDF file in pager
  3. #
  4. # Notes:
  5. # - $PAGER must be 'less -R' or 'most'
  6. # - To use mutool, uncomment the relevant lines and comment the pdftotext line
  7. #
  8. # Shell: POSIX compliant
  9. # Author: Arun Prakash Jana
  10. if [ -n "$1" ]; then
  11. if [ "$(head -c 4 "$1")" = "%PDF" ]; then
  12. # Convert using pdftotext
  13. pdftotext -nopgbrk -layout "$1" - | sed 's/\xe2\x80\x8b//g' | $PAGER
  14. # Convert using mutool
  15. # file=`basename "$1"`
  16. # txt=/tmp/"$file".txt
  17. # mutool convert -o "$txt" "$1"
  18. # eval $PAGER $txt
  19. # rm "$txt"
  20. fi
  21. fi