As we had discussed in one of my previous article regarding alfresco media-previewer that alfresco use third party tool for content manipulation in backend. We can generate pdf files from word document.
Now there are requirements when user wants to keep pdf copy of any word content For instance invoices normally we create invoice in word document and then send pdf copy of final version of invoice to client for payment.
Way to achieve it?
We can create pdf document from word using available rule which invoke that transformation action based on content update or content create event. Now here we may be updating word version of invoice multiple times before finalizing it so that mean we have to create rule on content update.
Problem with content update rule.
Issue with that approach is that it first time create content successfully but later on whenever you update content it will fail because pdf file with same name already exist on destination.
How to solve?
To deal with this problem we need to create simple script which invoke content transformation action and before generating pdf it search for existing pdf file if exist it delete it and create new one.
Here is that script.
Summary: As I always mention script is very powerful tool within alfresco which can help you to deal with many such issues. Happy coding!
- See more at: http://blog.arvixe.com/alfresco-pdf-generation-from-word-document/#sthash.jr8nyqy1.dpuf