#!/bin/bash export D=$HOME/.tmp cp $1 $D cd $D rm *sliced*.tif rm out*.tif pdf2c4 < `basename $1` for o in out*.tif; do export LEN=`tiffdump out-000.tif | grep Length | cut -f 5 -d ' ' | cut -f 2 -d '<' | cut -f 1 -d '>'` slice $o $(( $LEN / 2 )) $LEN mv $o.sliced.$(( $LEN / 2)).tif $o.slicedb.tif slice $o 0 $(( $LEN / 2 )) mv $o.sliced.0.tif $o.sliceda.tif done ls out-*.tif.sliced*.tif | xargs c42pdf -o `basename $1`