Last active
August 29, 2015 14:18
-
-
Save PeterTheOne/0ce0d04d8d09c7535597 to your computer and use it in GitHub Desktop.
split bawag-psk bank pdfs
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 | |
cd Kontoauszuege/ | |
for directory in */ ; do | |
echo "$directory" | |
cd ${directory} | |
for file in *.pdf ; do | |
# echo "$file to ../../Kontoauszuege_single/$directory$file" | |
pdftk ${file} burst output ../../Kontoauszuege_1pagers/${directory}${file}_pg_%04d.pdf | |
done | |
cd .. | |
done | |
cd .. | |
cd Kontoauszuege_1pagers/ | |
for directory in */ ; do | |
echo "$directory" | |
cd ${directory} | |
for file in ./*_pg_*.pdf ; do | |
echo "$file" | |
gs -o ../../Kontoauszuege_single/${directory}${file}C.pdf -sDEVICE=pdfwrite -g5950x2800 -c "<</PageOffset [0 0]>> setpagedevice" -f ${file} | |
gs -o ../../Kontoauszuege_single/${directory}${file}B.pdf -sDEVICE=pdfwrite -g5950x2800 -c "<</PageOffset [0 -281]>> setpagedevice" -f ${file} | |
gs -o ../../Kontoauszuege_single/${directory}${file}A.pdf -sDEVICE=pdfwrite -g5950x2800 -c "<</PageOffset [0 -561]>> setpagedevice" -f ${file} | |
done | |
cd .. | |
done | |
cd .. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment