cancel
Showing results for 
Search instead for 
Did you mean: 

Content transformers choice, fallback or default settings

deajan
Champ on-the-rise
Champ on-the-rise
Hello,

I've setup a test VM of Alfresco 4.2c community edition.
I adapted a tiff2pdf content transformer xml file for ABBYY Finereader OCR, which works, but gets somehow overrided by ImageMagick's own tiff2pdf transformer.

When i launch Alfresco server, the transformer i made works, checked via the page:
http://myalfrescoserver.local:8080/alfresco/service/mimetypes?mimetype=image/tiff#image/tiff
which outputs this:

application/rtf = Proxy via: org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerWorker(ABBYY FineReader Engine 9.0 Sample © ABBYY. 2010.)

My problem is that once i've used that transformer (which seams to work great at first usage and produces a good PDF document), alfresco automagically switches to ImageMagick instead of mine.
I  can check this because the output of
http://myalfrescoserver.local:8080/alfresco/service/mimetypes?mimetype=image/tiff#image/tiff

gives the following once a transformation has been done:

application/pdf = Proxy via: $Proxy9(Version: ImageMagick 6.5.6-10 2012-04-13 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC)

The only way i can revert to my transformer is to relaunch alfresco service. But it always gets replaced on first usage. Also, sometimes relaunching the alfresco service doesn't do the trick, i have to relaunch it again.
I've tried to figure out where the preferences are set, without success.
I've also tried to disable the imagemagick bean in content-services-context.xml, without success.
I've checked that the command my transformer executes does return "0" value so it stays usable.

I'm not really a java addict so i'm quite lost.
Any ideas would be greatly appreciated.
Thanks.
2 REPLIES 2

deajan
Champ on-the-rise
Champ on-the-rise
Well i have a 'ugly' solution to disable ImageMagick (or simply reinstall and not choosing ImageMagick) but it works:


# mv /opt/alfresco-4.2.c/common/bin/.convert.bin /opt/alfresco-4.2.c/common/bin/.convert.old

This completly disables Imagemagick, including the tiff2pdf transformer which alfresco seems to have a preference for.
It works but this is a really ugly solution.

Anyone could help me find something nicer please ?

Thanks.

Hi Deajan

Let me ask you this question please as I am trying to get the same, a tiff to OCR PDF transformation with ABBYY OCR CLI for linux.

We have an Alfresco 4.2.f CE instance and ABBYY OCR4Linux CLI 9 installed in our ubuntu machine. We have checked that ABBYY OCR works fine, but we are not able to run the transformation in Alfresco.

First of all we have included in our web-client-config-custom.xml


<!– Add the tiff mime type to the list of supported transformations –>

    <config evaluator="string-compare" condition="Action Wizards">

        <transformers>

            <transformer name="image/tiff"/>

        </transformers>

    </config>



and declared our transformation in tomcat/shared/classes/alfresco/extension


<?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="commandMap">
                    <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="commandMap">
                    <map>
                        <entry key=".*">
                            <list>
                                <value>
                                    abbyyocr9 -rl Spanish -fm -rdss -afoe -if ${source} -f PDF -pfpf LZWGray -pem ImageOnText -pfpr 300 -prl -o$
                                </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>
</beans>




Also in the http://localhost:8080/alfresco/service/mimetypes?mimetype=image/tiff#image/tiff  we obtain the right transformation details



image/tiff - tiff
Extractors: org.alfresco.repo.content.metadata.TikaAutoMetadataExtracter
Transformable To:

    application/eps = Proxy via: com.sun.proxy.$Proxy15(Version: ImageMagick 6.8.6-6 2013-07-24 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC Features: DPC Modules Delegates: freetype jng jpeg png ps tiff wmf zlib)
    application/pdf = Proxy via: org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerWorker(ABBYY FineReader Engine 9.0 Sample © ABBYY. 2010.


However when we launch this transformation, we are able to get a PDF, but including the TIFF image with no OCR obtained… which makes me think that Alfresco is not calling our transformation to create this PDF.

I have followed also your suggestion to disable ImageMagic…. but if I do so I get this error message


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:



Could you  please point me which steps exactly did you follow to get your transofrmation with ABBYY OCR CLI working??

Thanks a lot