Skip to content

Instantly share code, notes, and snippets.

@omerk
Last active December 14, 2015 08:59
Show Gist options
  • Save omerk/5061474 to your computer and use it in GitHub Desktop.
Save omerk/5061474 to your computer and use it in GitHub Desktop.
pdfextract ()
{
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ] ; then
echo "Usage: pdfextract <source doc> <first page> <last page>."
else
OUTPDF=$1_p$2-$3.pdf
pdftops $1 - | psselect -p$2-$3 | ps2pdf14 - $OUTPDF
echo "Output saved as: $OUTPDF"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment