Convert an image (.png, .jpeg, etc) into PDF

cancel
Showing results for 
Search instead for 
Did you mean: 
zlucy82
Active Member

Convert an image (.png, .jpeg, etc) into PDF

Hi all,

i need to generate a rendition node in "application/pdf" mimetype from one source node that is an whatever image. I check in my "localhost/alfresco/service/mimetypes?mimetype=*" url and i notice that the mimetype "application/pdf" is transformable only from "image/tiff" mimetype but i know that the ImageMagick library (used for the transformation of images) can convert any image format (.png, .jpeg, etc) into PDF.
So, what can i do? I must implement a "Custom Content Transformers" or add a "Custom MimeType" to obtain this? I work on Alfresco 5.1.0 Community Edition.

Thank you in advance

3 Replies
kalpesh_c2
Senior Member

Re: Convert an image (.png, .jpeg, etc) into PDF

Hi Lucy Zarbano‌,

Get the list of registered mimetypes from url http://hostSmiley Tongueort/alfresco/s/mimetypes in your alfresco.

And check your document can be Transformable To or Transformable From .
Transformable to - current possible transformation of document can be transform to mimetypes.

Transformable from - current possible transformation of document can be transform from mimetypes.
If your required mimetype is available in the above then you can transform by code or from UI rules.

Thanks,
Kalpesh,

ContCentric

zlucy82
Active Member

Re: Convert an image (.png, .jpeg, etc) into PDF

Hi, i just did it, in the list of registered mimetypes from "http://hostSmiley Tongueort/alfresco/s/mimetypes" i notice that application/pdf mimetype is trasformable only FROM image/tiff mimetype but i need to transform a document with image/png, image/jepg, etc ..  mimetype INTO application/pdf mimetype. Is there a solution?

douglascrp
Advanced II

Re: Convert an image (.png, .jpeg, etc) into PDF

You have to create a new custom transformer.

The information you need (including sample code) is available at Content Transformers (and Renditions) | Alfresco Documentation