I am trying to use the transformDocument function to convert a text file into a pdf file.
I have a custom content type (text file) with a custom action - this action calls the custom web script to convert to pdf.
For one time transformation , it works fine. However, if I modify content in the same file then try to convert this into pdf, it raises the duplicate name error.
In the custom webscript file:
var nodeRef = utils.getNodeFromString(args["nodeRef"]);
var newPdf = nodeRef.transformDocument("application/pdf");
model.pdfNodeRef = newPdf;
I tried exception handlings to catch this error.
I also tried to add the version name to newPdf node.
Could anyone give me some suggestions please?
Please note that I am working on Alfresco 5.1.1