cancel
Showing results for 
Search instead for 
Did you mean: 

Transform content when it's being downloaded

machtech
Champ in-the-making
Champ in-the-making
Hi all,

Pretend I have items that are stored as text in the repository, but when the user clicks to download the file, I want to automatically transform the content to PDF.

How can I achieve this "on-the-fly" transformation on the way out of the repository?

Regards,
Johan
3 REPLIES 3

mrogers
Star Contributor
Star Contributor
The easiest way to do this is to use a rule to transform the content on upload.   And then your users download the PDF.

If each user needs their own copy of the PDF, for example if it is watermarked in some way,  then you need to inject your transformation code into a content reader.

machtech
Champ in-the-making
Champ in-the-making
Cheers for that, I will look into the content reader - can you point me at an example in the Alfresco codebase? Is there any documentation for extending one?

zaizi
Champ in-the-making
Champ in-the-making
We did this for a project. When a user downloads a content it does a custom transformation and applies watermarking and PDF encryption on the fly. Create and configure a custom download servlet to do this and use that as the download link. Please not however, that there is a performance implication to this. Doing transformation on the fly isn't going to scale very easily.