export pdf per two pages
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
.name+"-"+app.activeDocument.pages[app.activeDocument.pages.length-1].name;
else
pageRange = app.activeDocument.pages
.name+"-"+app.activeDocument.pages[p+SectionLength-1].name;
theFile = new File(pageRange+".pdf");
app.activeDocument.exportFile (ExportFormat.pdfType, theFile, false);
}
}