keensoft / alfresco-simple-ocr

Simple OCR action for Alfresco
Other
44 stars 30 forks source link

ocrpdf with docker #11

Closed antrosivas closed 8 years ago

antrosivas commented 8 years ago

Hello Angel, I'm running alfresco under Centos7 and I have installed ocrmypdf with docker. In alfresco-global.properties I have this configuration:

ocr.command=/opt/alfresco-community/scriptsme/ocrpdf ocr.output.verbose=true ocr.output.file.prefix.command= ocr.extra.commands= ocr.server.os=linux

and ocrpdf I have this:

!/bin/sh

docker run -v /opt/alfresco-community/tomcat/temp/Alfresco:/home/docker ocrmypdf --verbose 1 --force-ocr -l spa+eng+fra $1 $2

Passing parameters to ocrpdf fails because it happens absolute and routes would need only pass the name of the file source and destination. Is there any way of modifcar this?

Greetings and thanks for everything.

angelborroy-ks commented 8 years ago

Maybe the FAQ will help you.

antrosivas commented 8 years ago

Thanks, but I can not get it to work.

if I run

/opt/alfresco-community/scriptsme/ocrpdf OCRTransformWorker_source_298666486081123903.pdf OCRTransformWorker_source_298666486081123903_ocr.pdf

it works right, but if I run

/opt/alfresco-community/scriptsme/ocrpdf /opt/alfresco-community/tomcat/temp/Alfresco/OCRTransformWorker_source_298666486081123903.pdf /opt/alfresco-community/tomcat/temp/Alfresco/OCRTransformWorker_source_298666486081123903_ocr.pdf

ERROR - No way to run job: Input file '/opt/alfresco-community/tomcat/temp/Alfresco/OCRTransformWorker_source_298666486081123903.pdf' does not exist

I'm still investigating. Thank you

antrosivas commented 8 years ago

Solved. cutting the filenames. The script ocrpdf:

!/bin/bash

origenTam=expr length $1 origen=expr substr $1 46 $origenTam destinoTam=expr length $2 destino=expr substr $2 46 $destinoTam docker run -v /opt/alfresco-community/tomcat/temp/Alfresco:/home/docker ocrmypdf --verbose 1 --force-ocr -l spa+eng+fra $origen $destino

thank you very much for your attention