Trainings

Wednesday, July 30, 2014

InDesign Script : export InDesign book as a pdf

var filein ="/C/prashant/indd/Book1.indb" ; //path for indesign book which needs to be exported as pdf.
var fileout = "/C/prashant/indd/Book1.pdf" ;    //path for the exported pdf
var mypdf = new File(fileout);  //create pdf file object

//Open InDesign book
var book = app.open(File(filein));  //open book

//export book to pdf
book.exportFile(ExportFormat.PDF_TYPE,mypdf);

//close book
book.close(SaveOptions.NO);