new things

This commit is contained in:
ackman678
2021-03-30 00:37:43 -07:00
parent 14f1c48838
commit 6e92164bc3
8 changed files with 235 additions and 16 deletions

31
pdfsplit Executable file
View File

@@ -0,0 +1,31 @@
#!/bin/bash
if [ "$1" == "-h" ] ; then
echo "
pdfsplit - extract a range of pdf pages with ghostscript
usage:
pdfsplit firstPage lastPage inputFile.pdf
output file will be named inputfile_pXX-pYY.pdf
depends:
gs - ghostscript
"
exit 0
fi
# the following is from a stackoverflow answer
# function pdfsplit()
# {
# this function uses 3 arguments:
# $1 is the first page of the range to extract
# $2 is the last page of the range to extract
# $3 is the input file
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER \
-dFirstPage=${1} \
-dLastPage=${2} \
-sOutputFile=${3%.pdf}_p${1}-p${2}.pdf \
${3}
# }