#!/bin/bash
if [ $# -lt 3 -o $# -gt 4 ]; then
echo $usage
else
if [ $# == 3 ]; then
outfile=${3%.pdf}_p${1}-p${2}.pdf
else
outfile=${4}
fi
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER \
-dFirstPage=${1} \
-dLastPage=${2} \
-sOutputFile=${outfile} \
${3}
fi
On the command-line simple type:
pdfpextr firstpage lastpage inputfile [ouputfile]
No comments:
Post a Comment