03-21-2016 08:14 AM
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="transformer.worker.tiff2pdf" class="org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerWorker">
<property name="mimetypeService">
<ref bean="mimetypeService" />
</property>
<property name="checkCommand">
<bean class="org.alfresco.util.exec.RuntimeExec">
<property name="commandsAndArguments">
<map>
<entry key=".*">
<list>
<value>abbyyocr9</value>
</list>
</entry>
</map>
</property>
</bean>
</property>
<property name="transformCommand">
<bean class="org.alfresco.util.exec.RuntimeExec">
<property name="commandsAndArguments">
<map>
<entry key=".*">
<list>
<value>
abbyyocr9 -rl Spanish -fm -rdss -afoe -if ${source} -f PDF -pfpf LZWGray -pem ImageOnText -pfpr 300 -prl -of ${target}
</value>
</list>
</entry>
</map>
</property>
<property name="errorCodes">
<value>1,2</value>
</property>
</bean>
</property>
<property name="explicitTransformations">
<list>
<bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
<property name="sourceMimetype"><value>image/tiff</value></property>
<property name="targetMimetype"><value>application/pdf</value></property>
</bean>
</list>
</property>
</bean>
<bean id="transformer.tiff2pdf" class="org.alfresco.repo.content.transform.ProxyContentTransformer" parent="baseContentTransformer">
<property name="worker">
<ref bean="transformer.worker.tiff2pdf" />
</property>
</bean>
<bean id="transformer.worker.Jpg2pdf" class="org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerWorker">
<property name="mimetypeService">
<ref bean="mimetypeService" />
</property>
<property name="checkCommand">
<bean class="org.alfresco.util.exec.RuntimeExec">
<property name="commandsAndArguments">
<map>
<entry key=".*">
<list>
<value>abbyyocr9</value>
</list>
</entry>
</map>
</property>
</bean>
</property>
<property name="transformCommand">
<bean class="org.alfresco.util.exec.RuntimeExec">
<property name="commandsAndArguments">
<map>
<entry key=".*">
<list>
<value>
abbyyocr9 -if ${source} -f PDF -pfpf JpegColor -pem ImageOnText -pfpr 200 -pfq 100 -prl -of ${target}
</value>
</list>
</entry>
</map>
</property>
<property name="errorCodes">
<value>1,2</value>
</property>
</bean>
</property>
<property name="explicitTransformations">
<list>
<bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
<property name="sourceMimetype"><value>image/jpeg</value></property>
<property name="targetMimetype"><value>application/pdf</value></property>
</bean>
</list>
</property>
</bean>
<bean id="transformer.Jpg2pdf" class="org.alfresco.repo.content.transform.ProxyContentTransformer" parent="baseContentTransformer">
<property name="worker">
<ref bean="transformer.worker.Jpg2pdf" />
</property>
</bean>
</beans>
<config evaluator="string-compare" condition="Action Wizards" replace="false">
<transformers>
<transformer name="image/tiff"/>
</transformers>
</config>
03-22-2016 04:51 AM
03-23-2016 01:23 PM
org.alfresco.service.cmr.repository.ContentIOException: 02220014 Content conversion failed:
reader: ContentAccessor[ contentUrl=store://2016/3/22/19/8/c645e8f5-ef22-43a1-b593-eef80fb702b3.bin, mimetype=image/tiff, size=113244, encoding=UTF-8, locale=es_CL]
writer: ContentAccessor[ contentUrl=store://2016/3/22/19/8/4cf527dd-d17f-41ef-843f-262b9c744357.bin, mimetype=application/pdf, size=0, encoding=UTF-8, locale=es_CL]
options: {targetContentProperty={http://www.alfresco.org/model/content/1.0}name, contentReaderNodeRef=workspace://SpacesStore/16875bd0-0039-48a0-a670-8d3b87e21fc3, contentWriterNodeRef=workspace://SpacesStore/de83616b-0433-420c-84e2-e18c731aae1b, sourceContentProperty={http://www.alfresco.org/model/content/1.0}name, use=null, includeEmbedded=false}
limits:
03-24-2016 01:09 AM
https://github.com/keensoft/alfresco-simple-ocr/blob/master/simple-ocr-repo/src/main/amp/config/alfr...
puedes ver cómo mapeamos nosotros los argumentos de la línea de comandos.03-30-2016 12:16 PM
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="transformer.tiff2pdf" class="org.alfresco.repo.content.transform.ProxyContentTransformer" parent="baseContentTransformer">
<property name="worker">
<ref bean="transformer.worker.tiff2pdf" />
</property>
</bean>
<bean id="transformer.worker.tiff2pdf" class="org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerWorker">
<property name="mimetypeService">
<ref bean="mimetypeService" />
</property>
<property name="checkCommand">
<bean class="org.alfresco.util.exec.RuntimeExec">
<property name="commandsAndArguments">
<map>
<entry key=".*">
<list>
<value>abbyyocr9</value>
</list>
</entry>
</map>
</property>
</bean>
</property>
<property name="transformCommand">
<bean class="org.alfresco.util.exec.RuntimeExec">
<property name="commandsAndArguments">
<map>
<entry key=".*">
<list>
<value>abbyyocr9</value>
<value>-rl</value>
<value>Spanish</value>
<value>-fm</value>
<value>-rdss</value>
<value>-afoe</value>
<value>-if</value>
<value>${source}</value>
<value>-f</value>
<value>PDF</value>
<value>-pfpf</value>
<value>LZWGray</value>
<value>-pem</value>
<value>ImageOnText</value>
<value>-pfpr</value>
<value>300</value>
<value>-prl</value>
<value>-of</value>
<value>${target}</value>
</list>
</entry>
</map>
</property>
<property name="errorCodes">
<value>1,2</value>
</property>
</bean>
</property>
<property name="explicitTransformations">
<list>
<bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
<property name="sourceMimetype"><value>image/tiff</value></property>
<property name="targetMimetype"><value>application/pdf</value></property>
</bean>
</list>
</property>
</bean>
<bean id="transformer.worker.Jpg2pdf" class="org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerWorker">
<property name="mimetypeService">
<ref bean="mimetypeService" />
</property>
<property name="checkCommand">
<bean class="org.alfresco.util.exec.RuntimeExec">
<property name="commandsAndArguments">
<map>
<entry key=".*">
<list>
<value>abbyyocr9</value>
</list>
</entry>
</map>
</property>
</bean>
</property>
<property name="transformCommand">
<bean class="org.alfresco.util.exec.RuntimeExec">
<property name="commandsAndArguments">
<map>
<entry key=".*">
<list>
<value>abbyyocr9</value>
<value>-if</value>
<value>${source}</value>
<value>-f</value>
<value>PDF</value>
<value>-pfpf</value>
<value>JpegColor</value>
<value>-pem</value>
<value>ImageOnText</value>
<value>-pfpr</value>
<value>200</value>
<value>-pfq</value>
<value>100</value>
<value>-prl</value>
<value>-of</value>
<value>${target}</value>
</list>
</entry>
</map>
</property>
<property name="errorCodes">
<value>1,2</value>
</property>
</bean>
</property>
<property name="explicitTransformations">
<list>
<bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
<property name="sourceMimetype"><value>image/jpeg</value></property>
<property name="targetMimetype"><value>application/pdf</value></property>
</bean>
</list>
</property>
</bean>
<bean id="transformer.Jpg2pdf" class="org.alfresco.repo.content.transform.ProxyContentTransformer" parent="baseContentTransformer">
<property name="worker">
<ref bean="transformer.worker.Jpg2pdf" />
</property>
</bean>
</beans>
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.