Browse Source

Updated open-pdf to be able to handle opening to page numbers

Samuel W. Flint 7 years ago
parent
commit
4c807a8c53
1 changed files with 12 additions and 5 deletions
  1. 12 5
      open-pdf

+ 12 - 5
open-pdf

@@ -2,12 +2,19 @@
 # -*- shell-script -*-
 
 if [ $# -lt 1 ] ; then
-    echo "open-pdf file"
+    echo "open-pdf file [ page-number ]"
     exit
 fi
-
-if [[ -e `which evince` ]] ; then
-    evince $1
+if [[ $# == 2 ]] ; then
+    if [[ -e `which evince` ]] ; then
+        evince -p $2 $1
+    else
+        xpdf $1 $2
+    fi
 else
-    xpdf $1
+    if [[ -e `which evince` ]] ; then
+        evince $1
+    else
+        xpdf $1
+    fi
 fi