2 Replies Latest reply on Jan 27, 2015 9:05 PM by csm_phil

    i am trying to export the combained PDF based on BOOK opetion using below scripts. but i am getting following error message "Invalid value for parameter 'to' of method 'exportFile'. Expected File, but received 1952403524". anyone knows, please suggest me

    Jackkistens Level 1


      Dear ALL,

       

      i am trying to export the combained PDF based on BOOK opetion using below scripts. but i am getting following error message "Invalid value for parameter 'to' of method 'exportFile'. Expected File, but received 1952403524". anyone knows, please suggest me solutions.

       

      var myBookFileName ,myBookFileName_temp;

                      if ( myFolder != null )

                      {

                              var myFiles = [];

                              var myAllFilesList = myFolder.getFiles("*.indd");    

                              for (var f = 0; f < myAllFilesList.length; f++)

                                  {

                                          var myFile = myAllFilesList[f]; 

                                          myFiles.push(myFile);

                                  }     

                              if ( myFiles.length > 0 )

                                  {

                                          myBookFileName = myFolder + "/"+ myFolder.name + ".indb";

                                          myBookFileName_temp=myFolder.name ;

                                          myBookFile = new File( myBookFileName );

                                          myBook = app.books.add( myBookFile );  

                                         myBook.automaticPagination = false;

                                          for ( i=0; i < myFiles.length; i++ )

                                              {             

                                                     myBook.bookContents.add( myFiles[i] );             

                                              }

                                         

                                          var pdfFile =File(File(myFolder).fsName + "\\"+myBookFileName_temp+"_WEB.pdf");

                                          var bookComps = myBook.bookContents;

                                          if (bookComps.length === 1)

                                              {

                                                         bookComps = [bookComps];

                                               }

                                           var myPDFExportPreset = app.pdfExportPresets.item("AER6");

                                          app.activeBook.exportFile(ExportFormat.PDF_TYPE,File("D:\\AER\\WEBPDF.pdf"),false,myPDFEx portPreset,bookComps);

                                        //myBook.exportFile (ExportFormat.pdfType, pdfFile, false);

                                        //myBook.exportFile(pdfFile, false, pdfPref, bookComps);

                                          myBook.close(SaveOptions.yes);      

                                  }

                         }