cancel
Showing results for 
Search instead for 
Did you mean: 

Convert files to PDF

croc
Champ in-the-making
Champ in-the-making
Hi,

I need to convert files to PDF in share.

I have the code below, but it does not work.
 onActionTransformDocument: function dlA_onActionTransformDocument(asset)
      {
         var displayName = asset.displayName, fileName = asset.fileName,
            nodeRef = new Alfresco.util.NodeRef(asset.nodeRef);
    var resultString = "failed", resultCode = false;
            resultString = "convert.failed";
         var nodeTrans = nodeRef.transformDocument("application/pdf");
         if (nodeTrans != null)
           {
              resultString = "converted";
              resultCode = true;
           }
      },

Can someone help me.

Thanks,
Croc
2 REPLIES 2

muthukimoses
Champ in-the-making
Champ in-the-making
creating a rule should be simpler.

croc
Champ in-the-making
Champ in-the-making
A rule converts all files that goes into a folder if i have created it on a folder. But I only want it on a file, I have added a menu item for that but now it doesn't work when I click it. So in short I only want to convert selected files.

Thanks
Croc