Bash script:
#!/bin/bash #sudo apt-get install djvulibre-bin imagemagick libtiff-tools #rm *.tif for (( i=0; i<=317; i++ )) do ddjvu -page=$i -format=tiff assimil_france.djvu tmp$i.tif convert tmp$i.tif -crop 50%x100% $i%d.tif rm tmp$i.tif done for a in [0-9]*.tif; do mv $a "printf %05d.%s ${a%.*} ${a##*.}" done tiffcp *.tif out.tif && tiff2pdf out.tif -j -o out.pdf && rm *.tif