My build of nnn with minor changes
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

25 行
615 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 ! [ -z "$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