How to export an indd document (selection) as PNG?


dear all,

 

i have couple of indd document , each has 1 table (also 1 page per document). want convert table png. tried result exported page size.

i unable select table's text frame.

 

#target indesign

var sourcefolder = new folder ("/users/admin4/desktop/ins");

 

var myfiles = sourcefolder.getfiles();

//alert (myfiles.length);

 

var destfolder = new folder ("/users/admin4/desktop/folder5");

 

//var destfile = new file(destfolder + "/" + + ".png");

//alert(destfile);

 

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

{

     var sourcedoc = app.open(myfiles[i]);

 

    var destfile = new file(destfolder + "/" + myfiles[i].name + ".png");

   

     sourcedoc.exportfile(exportformat.png_format, destfile, false);  

     sourcedoc.close(saveoptions.no);

   

    }

 

try this,

 

#target indesign

var sourcefolder = new folder ("/users/admin4/desktop/ins");

 

var myfiles = sourcefolder.getfiles();

//alert (myfiles.length);

 

var destfolder = new folder ("/users/admin4/desktop/folder5");

 

//var destfile = new file(destfolder + "/" + + ".png");

//alert(destfile);

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

{

      sourcedoc = app.open(myfiles[i]);

 

   app.activedocument.stories[0].tables[0].parent.select();

    

  

    var destfile = new file(destfolder + "/" + myfiles[i].name + ".png");

  

     app.selection[0].exportfile(exportformat.png_format, destfile, false); 

     sourcedoc.close(saveoptions.no);

  

    }

 

vandy



More discussions in InDesign Scripting


adobe

Comments

Popular posts from this blog

how to devide a circle into equal parts

"Could not fill because there are not enough opaque source pixels" - not solved by any other thread

Why can't I change the billing info for my account?