cancel
Showing results for 
Search instead for 
Did you mean: 

converting tiff image to pdf

stoutg
Champ in-the-making
Champ in-the-making
Is it possible to convert a Tiff, or any image, to PDF format with Alfresco?

I downloaded the Tomcat bundle of Alfresco 2.0.0 and started it.

I looked through the catalina.out multiple times trying to find any mention that OpenOffice or ImageMagick did not connect to Alfresco but could not find any.  I then tried to convert a Tiff to a PDF and got an error
    A system error happened during the operation: Transaction didn't commit: No transformation exists between mimetypes image/tiff and application/pdf
I was able to convert a Tiff and PNG into JPGs as well as a Word doc to PDF.  Can you only convert pictures to other picture formats?

Any help will be appreciated, thanks.
8 REPLIES 8

nickbailey
Champ in-the-making
Champ in-the-making
did you get an answer?

kevinr
Star Contributor
Star Contributor
No it is not currently possible to convert an image to anything other than another image format. However, saying that imagemagick does appear to support PDF and EPDF as output formats: http://www.imagemagick.org/script/formats.php

So in theory it should be possible. However currently the Alfresco image transformation service expects all mimetypes valid for image transformations to start with "image/" where-as PDF format is "application/pdf" - that is why it is failing. Looking round on the web suggests that having another mimetype for PDF as "image/pdf" is not unreasonable. Therefore if you add that mimetype the Alfresco mimetype-map.xml (or extend it see here: http://wiki.alfresco.com/wiki/Adding_a_Mime_Type) and then run the convert it will work - I've just tried it here and it produced a PDF no problem.

We will remove the need for this work-around in a future version: http://issues.alfresco.com/browse/AR-1737

Hope this helps,

Kevin

stoutg
Champ in-the-making
Champ in-the-making
Thank you for answering my question. 

Also thank you for adding it to the list of things to add to new releases.  It will make my life easier if Alfresco supports this out of the box.

nkeide
Champ in-the-making
Champ in-the-making
I also had to add the following to web-client-config-custom.xml so the new mime type will show up as a choice in, say, the Run Action Wizard:

   <config evaluator="string-compare" condition="Action Wizards">
         <!–
         Part of the work-around so images can be transformed into pdfs.
         See mimetypes-extension.xml for the full story.

         This is to add the extension of mime types made in mimetypes-extension.xml
         as a choices in run and rule wizards.
         –>
      <transformers>
         <transformer name="image/pdf" />
      </transformers>
   </config>

Also, I notice that the transformer doesn't seem to handle converting TIFFs to PDF that are multiple pages (such as from a fax server). It works OK on the first page but doesn't handle subsequent pages.

kevinr
Star Contributor
Star Contributor
Ah yes i forgot to mention that step Smiley Happy

The transforming is handled by Imagemagick - i suggest you post to their forums or send the developer an email if you need a new feature.

Thanks,

Kevin

nkeide
Champ in-the-making
Champ in-the-making
The latest version of ImageMagick fixes the problem with multiple pages in a TIFF image. http://www.imagemagick.org

kevinr
Star Contributor
Star Contributor
Excellent we can upgrade it on HEAD then. I suggest you try upgrading your binary and see if it works!

Thanks,

Kevin

nkeide
Champ in-the-making
Champ in-the-making
Yes, that is what we did.

So to recap: the image/pdf workaround above with the latest version of ImageMagick together with the existing application/pdf seems to be converting all the file types we are using to pdf OK.

Thanks.