Hi,
I am dealing with a problem when calling a script to do a transformation. I have a script in ubuntu that splits a multipage pdf in single page pdf files, then with convert (from imagemagick) transforms it to tif, then it generates the html with tesseract ocr, convert it back to pdf with the text layer, and merge everythin back into a single pdf with text layer.
The scripts works fine in the console, but in Alfresco, because of different enviroment variables in the path, use a different convert (/opt/alfresco-3.4.d/common/bin/convert) instead of /usr/bin/convert. The result is a pdf 1.3 instead a tiff so tesseract does not do nothing. The servlet is tomcat, I tried to copy the /usr/bin/convert to catalina home, and to alfresco common directory , rename the convert to conv and call it, etc but nothing happen.
How could I tell Alfresco to use the right convert instead of his /opt/alfresco-3.4.d/common/bin/convert
The script works fine until the convert, but gets executed all:
#!/bin/bash
LANG=eng
FILE=$1
TEMPS=`echo $FILE | md5sum | cut -c 1-32 `
mkdir /tmp/${TEMPS}
cd /tmp/${TEMPS}
echo “Split pages $FILE”
pdftk $FILE burst dont_ask output ${TEMPS}_%04d.pdf
for f in ${TEMPS}_*.pdf
do
f=`basename $f .pdf`
echo “Converting ${f}.pdf to tif”
convert -quiet -density 150 -depth 8 ${f}.pdf ${f}.tif #ALFRESCO MAKES /COMMON/BIN/CONVERT
done
How could I force to get the right convert
Cheers