2 Replies Latest reply on Jul 26, 2013 5:34 AM by rajnikids

    Export PDF to path


      Hi everybody,


      I do have a challenge in exporting PDF to particular folder called "PDF".


      The PDF path to be exported inside the folder News/PDF/. //PDf file path.


      where indesign file will be inside News/File1/untitled.indd. //indesign File path


      The ESTK shows the error result... as "Cant find the folder".




      var myFolderPDF = Folder(app.activeDocument.filePath).parent + "/PDF/"

      var myJobOptionName = "Paper"; //Please provide a PDF job option name which is available in InDesign.

      var myOutFolderPathName = Folder(app.activeDocument.filePath).parent + "/PDF/"; //Please change your path as per requirement


      var myPDFFilePath=myOutFolderPathName;

      var InDJobOption = app.pdfExportPresets;

      app.documents[0].exportFile (ExportFormat.pdfType, myPDFFilePath, false, myJobOptionName);


      thanks forum

        • 1. Re: Export PDF to path
          rajnikids Level 1

          Also used this script from Forum..



          var myDoc = app.activeDocument;


          var myFolderName = myDoc.filePath;


          var myDocumentName =  myDoc.name.slice (0, -5);


          var myFilePath = myFolderName + "/" + myDocumentName + ".pdf";


          var myFile = new File(myFilePath);

          var myF = Folder(myFile.parent+"/") +"/PDF/"  // here pdf should be saved inside the folder "PDF".


          myDoc.exportFile(ExportFormat.pdfType, myF, false, "Press Quality");

          • 2. Re: Export PDF to path
            rajnikids Level 1

            Thanks I found it...



            var myFolder = app.activeDocument.filePath.parent + "/PDF/";

            var myDoc = app.activeDocument;

            var myDocname = myDoc.name.split(".indd");

            myDoc.exportFile(ExportFormat.PDF_TYPE, File(new File(myFolder+"/" + myDocname.join(".pdf"))));