C
3: Documents
HAPTER
Exporting PDF with Interactive Features
The following script shows how to export a document with interactive features as a PDF. (For the complete
script, see ExportInteractivePDF.)
//Given a document "myDocument," add page transitions...
for(var myCounter = 0; myCounter < myDocument.spreads.length; myCounter++){
myDocument.spreads.item(myCounter).pageTransitionType
PageTransitionTypeOptions.wipeTransition;
myDocument.spreads.item(myCounter).pageTransitionDirection =
PageTransitionDirectionOptions.down;
myDocument.spreads.item(myCounter).pageTransitionDuration =
PageTransitionDurationOptions.medium;
}
app.interactivePDFExportPreferences.flipPages = true;
app.interactivePDFExportPreferences.flipPagesSpeed = 5;
app.interactivePDFExportPreferences.openInFullScreen = true;
app.interactivePDFExportPreferences.interactivePDFInteractiveElementsOption =
InteractivePDFInteractiveElementsOptions.includeAllMedia;
//Export the document to PDF.
myDocument.exportFile(ExportFormat.interactivePDF,File(Folder.desktop +
"/InteractivePDF.pdf"), false);
Exporting Pages as EPS
When you export a document as EPS, InDesign saves each page of the file as a separate EPS graphic (an
EPS, by definition, can contain only a single page). If you export more than a single page, InDesign
appends the index of the page to the filename. The index of the page in the document is not necessarily
the name of the page (as defined by the section options for the section containing the page).
Exporting all pages to EPS
The following script exports the pages of the active document to one or more EPS files. (For the complete
script, see ExportAsEPS.)
var myFile = new File("/c/myTestFile.eps");
app.activeDocument.exportFile(ExportFormat.epsType, myFile, false);
Exporting a range of pages to EPS
To control which pages are exported as EPS, set the
a page-range string containing the page or pages you want to export, before exporting. (For the complete
script, see ExportPageRangeAsEPS.)
//Enter the name of the page you want to export in the following line.
//Note that the page name is not necessarily the index of the page in the
//document (e.g., the first page of a document whose page numbering starts
//with page 21 will be "21", not 1).
app.epsExportPreferences.pageRange = "1-3, 6, 9";
var myFile = new File("/c/myTestFile.eps");
app.activeDocument.exportFile(ExportFormat.epsType, myFile, false);
property of the EPS export preferences to
page range
Exporting Pages as EPS 48