AnsweredAssumed Answered

Document transformation error--need help

Question asked by ashokharnal on Apr 27, 2012
Latest reply on May 2, 2012 by mitpatoliya
I am using the following code to transform pdf files to txt files but get
error in transformation (version 3.4.d).


// Get node to Drafts folder
var draftfolder =  companyhome.childByNamePath("Sites/myoffice/documentLibrary/AURC Space/DEO/Drafts") ;
// Children of Drafts folder
var draftfiles = draftfolder.children ;
// Number of children in Drafts
var filenumb = draftfiles.length ;

// Go through each file, one by one
for ( i = 0 ; i < filenumb ; i++ )
{
   var docnode = draftfiles[i] ;
   if ( ! docnode.isContainer )
      {
         if (docnode.size != 0 )
            {
            // Transform each document                    
            var newtxtNode = docnode.transformdocument("text/plain") ;
            }
        }
}

There is type error while transforming. Am I to typecast 'docnode' before using 'docnode.transformdocument()' function.

I shall be grateful for help.

Ashok Kumar Harnal

Outcomes