AnsweredAssumed Answered

alfresco - convert docx to pdf and create a new version

Question asked by spyridon.xanthopoulos on Feb 7, 2017
Latest reply on Mar 29, 2017 by mehe

I' m trying to convert a docx document to pdf and store the newly created pdf file as a new version. This is the test code:

 

var document = search.findNode("workspace://SpacesStore/30f334f3-d357-4ea6-a09f-09eab2da7488"); 

var folder = document.parent 

var pdf = document.transformDocument('application/pdf');


document.name = "new-" + document.name + ".pdf"; d

ocument.mimetype = "application/pdf";

document.content = pdf.content;

document.save();

 

The document ends up empty. Is this type of conversion possible with javaScript?

Outcomes