Inspiring
November 5, 2022
Question
problem with export pdf function
- November 5, 2022
- 5 replies
- 6736 views
hi every body, i have sometime (but not every time ) a problem on result to export pdf
main source is great, result have square...
and if i repeat my script it become ok (attached picture)
function exporttopdf() {
var myDocument = app.activeDocument; //Or set it with or replace it with the document object you might have
//if (myResult == true){
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 = false;
app.interactivePDFExportPreferences.interactivePDFInteractiveElementsOption =
InteractivePDFInteractiveElementsOptions.includeAllMedia;
var docName = myDocument.name.replace(/\.[^\.]+$/, "");
var outputFolder = Folder(myDocument.filePath);
var newFile = File(decodeURI(outputFolder) + "/" + docName + ".pdf");
myDocument.exportFile(ExportFormat.interactivePDF, newFile, false); //Change the file path and file name as needed
// }
}
