Created
January 27, 2020 13:10
-
-
Save zelinskiy/a0db0470e23839251829053766d468cb to your computer and use it in GitHub Desktop.
This file contains 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/bash | |
# usage: | |
# $ sh mksigs.sh 24 input.pdf | |
D=$1 | |
INPUT=$2 | |
I=1 | |
N=$(qpdf --show-npages $INPUT) | |
SIGN=1 | |
mkdir out_$INPUT | |
while [ $I -le $N ] | |
do | |
BEGIN=$I | |
if [ $((I+D-1)) -le $N ] | |
then | |
END=$((I+D-1)) | |
else | |
END=$N | |
fi | |
echo "$BEGIN-$END" | |
qpdf --empty --pages $INPUT $BEGIN-$END -- out_$INPUT/sig$SIGN.ps | |
I=$((I+D)) | |
SIGN=$((SIGN+1)) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment