Here's the solution I use (it's based on @Dingo's basic principle, but uses an easier approach for the PDF manipulation):
First, I create a PDF file with a single blank page somewhere, e.g. in "/path/to/blank.pdf".
Then, from the directory that contains all my pdf files, I run a little script that appends the blank.pdf file to each pdf with an odd page number:
#!/bin/bash
for f in *.pdf; do
let npages=$(pdfinfo "$f"|grep 'Pages:'|awk '{print $2}')
let modulo="($npages %2)"
if [ $modulo -eq 1 ]; then
pdftk "$f" "/path/to/blank.pdf" output "aligned_$f"
else
cp "$f" "aligned_$f"
fi
done
Now, all "aligned_" files have even page numbers, and I can join them using
pdftk aligned_*.pdf output result.pdf
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…