PDF to Tiff


This script is 'pdf2tif'.
It should run in the background: start it with 'pdf2tif &' from a shell or start it in the background at system boot time.

Replace the two directories below with actual input and output directories and LOGFILE with whichever logfile is desired.

Make sure the script has sufficient permission to read and delete the input files and to write the output files


while true; do FILE=`ls $INDIR | head -1`

The following sleep has a dual purpose. First it prevents the script from consuming large resources. Second it ensures that the input file is completely written before we attempt to read it. If input files are very large or if input files are received over a slow network the sleep should be increased appropriately.

sleep 5
if [ X$FILE != X ]; then
ecconv -exp tif \
-resolution 300 \
if [ $? -ne 0 ]; then
echo "Conversion of $FILE failed" >> $LOGFILE