6 Replies Latest reply on Jul 20, 2014 4:23 AM by 040767

    export pdf per two pages

    040767 Level 1

      Hey all,

       

      I need to export to pdf in 2-page-increments

       

      I found a somewhat similar script here in the forum but can't get it to work. Must be an error somewhere

       

      Would someone please check and correct this for InD CC2014?

       

      Thanks so much.

       

      // Output PDF pages per 2 pages.  //

      var SectionLength = 2;

      for (var p=0; p<app.activeDocument.pages.length; p += SectionLength)

      {

           with(app.pdfExportPreferences)

           {

                if (p+SectionLength-1 > app.activeDocument.pages.length)

                     pageRange = app.activeDocument.pages[p].name+"-"+app.activeDocument.pages[app.activeDocument.pages.le ngth-1].name;

                else

                     pageRange = app.activeDocument.pages[p].name+"-"+app.activeDocument.pages[p+SectionLength-1].name;

                theFile = new File(pageRange+".pdf");

                app.activeDocument.exportFile (ExportFormat.pdfType, theFile, false);

           }

      }