There are several resources on the web explaining how one can split a PDF into many files with on page per file.But how can you split them into chunks of, say, five pages each? I have looked into the standard tools such as pdftk but could not find an option doing what I want.
Split PDF into documents with several pages each
scripting;pdf;split
pdftk is able to cut out a fixed set of pages efficiently. With a bit of scripting glue, this does what I want:number=$(pdfinfo -- $file 2> /dev/null | awk '$1 == Pages: {print $2}')count=$((number / pagesper))filename=${file%.pdf}counter=0while [ $count -gt $counter ]; do   start=$((counter*pagesper + 1));  end=$((start + pagesper - 1));  counterstring=$(printf %04d $counter)  pdftk $file cat ${start}-${end} output ${filename}_${counterstring}.pdf  counter=$((counter + 1))doneThis assumes that you have the number of pages per chunk in $pagesper and the filename of the source PDF in $file.If you have acroread installed, you can also useacroread -size a4 -start $start -end $end -pairs $file ${filename}_${counterstring}.psacroread offers the option -toPostScript which may be useful.