cancel
Showing results for 
Search instead for 
Did you mean: 

Transform to PDF

preetigupta
Champ in-the-making
Champ in-the-making
Hi,
I have a requirement where when a content is created in web project and submitted for deployment, the rendition of the dcument should be created.

Say, I have a web project called "Gov"
User through his sandbox, will browse to the website, and upload a word document.
User will now submit this document to a workflowfor deployment. I have written a small java script in the workflow to create a PDF rendition
<task-node name="adhoc">
      <task name="wf:adhocTask" swimlane="assignee"> </task>
      <transition name="" to="completed">
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
           <script>
               logger.log("trying to create file and make it versionable");
               var doc1 = bpm_package.children[0];               
               var trans1 = doc1.transformDocument("application/pdf"); 
             </script>
         </action>
      </transition>
   </task-node>

I do get the log printed in alfresco.log and nowhere error is reported, but the pdf file is not created. Or, the pdf is created but is not visible in that web project. Where would alfresco create the PDF in this case?

I have deployed the same workflow in Document management, and when I run the workflow on any content cretaed in any space, pdf is created in the same space.

Any help would be appreciated.

Thanks and Regards
Preeti Gupta
3 REPLIES 3

preetigupta
Champ in-the-making
Champ in-the-making
Hi,

Has anyone implemented this functionality?

Thanks and Regards
Preeti Gupta

mrogers
Star Contributor
Star Contributor
The problem is that the content transformation stores your PDF rendering in the spaces store rather than the WCM's avm store.   So the pdf rendering is not part of your "web project" and therefore can't be deployed.

An easy fix may be to to copy in your PDF file to the web project after it's created.     You may also be able to tweak the destination of the transformed document.

preetigupta
Champ in-the-making
Champ in-the-making
Hi mrogers,

Thanks so much for your reply. Would that feature be available in 3.3. Do you suggest I can raise a feature request in JIRA?

Also, if you have little time, would you please guide me what step should I take based on requirements below.

In context of WCM : User would either upload documents or create webform.
Now if pdf cannot be created in WCM, then user would have to upload a document in DM and create web form in WCM.
We would like user to navigate to only one place for any type of document creation
Q1. Is it possible anyhow user can create a web form in DM?
Q2. If user has to create word document in DM (so that PDF transformation can take place), the drawback is, user would not be able to create document in appropriate site folder.
Q3. In context of Q2, do you suggest I should maintain categorization of content so that pdf is copied to a folder in web project based on these categories.
Q4. Let me know the best approach possible in Alfresco. My simple requirement is I want user to navigate as little as possible for creation of content.

Thanks for your help. Let me know, if you want me to raise this reply as a new thread.

Best Regards
Preeti Gupta