Created
December 8, 2015 08:37
-
-
Save tenomoto/56e1e62419087e322cf9 to your computer and use it in GitHub Desktop.
Extract pages from PDF and save them to separate files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
FNAME=$1 | |
shift | |
for PAGE in $@; do | |
gs -q -dBATCH -dNOPAUSE -dFirstPage=$PAGE -dLastPage=$PAGE \ | |
-dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode \ | |
-sDEVICE=pdfwrite -sOutputFile=${FNAME%\.pdf}_$PAGE.pdf $FNAME | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment