1 Reply Latest reply on Aug 23, 2013 10:40 PM by Learner Learner

    Need a script to export layer as a pdf

    Yogi _b

      Hi i have indesign with multiple layer i need a script to export each layer as a pdf with its own name.

      does anybody help pls.

      Screen shot 2013-08-24 at 10.33.07 AM.png

        • 1. Re: Need a script to export layer as a pdf
          Learner Learner Level 1

          Hi Yogi,

           

          Is this you required?

           

          var mydoc = app.activeDocument;

          var layer = mydoc.layers;

          var showhide = 0;

          for (var i =0;i<layer.length;i++){

                  for (var j=0;j<layer.length;j++){

                      layer[i].visible = false;

                 }

                  layer[showhide].visible = true;

                  mydoc.exportFile(ExportFormat.pdfType, File("/c/"+ layer[i].name +".pdf"),false);

                  for (var j=0;j<layer.length;j++){

                      layer[i].visible = false;

                   }      

                  showhide++

              }

           

          Regards,

          Learner