<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Alfresco Transform Ubuntu Script in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/alfresco-transform-ubuntu-script/m-p/259176#M212306</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; 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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The scripts works fine in the console, but in Alfresco, because of different enviroment variables in the path,&amp;nbsp; 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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How could I tell Alfresco to use the right convert instead of his /opt/alfresco-3.4.d/common/bin/convert&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The script works fine until the convert, but gets executed all:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#!/bin/bash&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LANG=eng&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FILE=$1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TEMPS=`echo $FILE | md5sum | cut -c 1-32 `&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mkdir /tmp/${TEMPS}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cd /tmp/${TEMPS}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;echo “Split pages $FILE”&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pdftk $FILE burst dont_ask output ${TEMPS}_%04d.pdf&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for f in ${TEMPS}_*.pdf&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;do&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;f=`basename $f .pdf`&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;echo “Converting ${f}.pdf to tif”&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;convert -quiet -density 150 -depth 8 ${f}.pdf ${f}.tif&amp;nbsp; #ALFRESCO MAKES /COMMON/BIN/CONVERT &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;done&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How could I force to get the right convert&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Apr 2012 13:12:56 GMT</pubDate>
    <dc:creator>acurs</dc:creator>
    <dc:date>2012-04-17T13:12:56Z</dc:date>
    <item>
      <title>Alfresco Transform Ubuntu Script</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/alfresco-transform-ubuntu-script/m-p/259176#M212306</link>
      <description>Hi,&amp;nbsp;&amp;nbsp; 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 te</description>
      <pubDate>Tue, 17 Apr 2012 13:12:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/alfresco-transform-ubuntu-script/m-p/259176#M212306</guid>
      <dc:creator>acurs</dc:creator>
      <dc:date>2012-04-17T13:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Alfresco Transform Ubuntu Script</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/alfresco-transform-ubuntu-script/m-p/259177#M212307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I solved this once by removing the environment variables for image magick and also setting the PATH environment variable accordingly. I used a perl script, not bash, but it is the same thing. My suggestion would be to dump&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;out your environment variables with the command &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;env&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt; and then set/unset/reset all that starts with MAGICK.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is how I did it in my perl script&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;# fix up env, as alfresco ships its own image magick&lt;BR /&gt;foreach my $k (keys %ENV) {&lt;BR /&gt;&amp;nbsp; if($k =~ m/^MAGICK/i) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; delete $ENV{$k};&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Dont forget to check and reset the PATH variables as well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;hope that helps,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; lothar&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 10:59:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/alfresco-transform-ubuntu-script/m-p/259177#M212307</guid>
      <dc:creator>lotharmärkle</dc:creator>
      <dc:date>2012-04-18T10:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Alfresco Transform Ubuntu Script</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/alfresco-transform-ubuntu-script/m-p/259178#M212308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Excellent I will try this inmediatly….&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I could make it work using gs instead of convert, but took me a lot of time to make it work gs command with the params and options behaves weird…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I setted /etc/enviroment, and then source enviroment and started right away&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 17:22:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/alfresco-transform-ubuntu-script/m-p/259178#M212308</guid>
      <dc:creator>acurs</dc:creator>
      <dc:date>2012-04-18T17:22:36Z</dc:date>
    </item>
  </channel>
</rss>

