Copy link to clipboard
Copied
Bonjour à tous,
Je souhaiterai exporter l'ensemble de mes variantes de mise en page d'un meme fichier dans des pdfs distinct. Est ce que quelqu'un saurait comment faire s'il vous plait ? Je ne trouve aucune formulation qui fonctionne.
Cordialement,
Claire.
Hi @Claire_Chr , With JS you can get the document’s alternate layer names via sections, so something like this might work—the dialog asks you to select a PDF preset then exports each layout as an alternate layout page range to your document’s parent folder:
makeDialog();
var pp;
function makeDialog(){
var theDialog = app.dialogs.add({name:"Choose a Preset", canCancel:true});
with(theDialog.dialogColumns.add()){
pp = dropdowns.add({stringList:app.pdfExportPresets.everyItem().na
Copy link to clipboard
Copied
Hi @Claire_Chr , With JS you can get the document’s alternate layer names via sections, so something like this might work—the dialog asks you to select a PDF preset then exports each layout as an alternate layout page range to your document’s parent folder:
makeDialog();
var pp;
function makeDialog(){
var theDialog = app.dialogs.add({name:"Choose a Preset", canCancel:true});
with(theDialog.dialogColumns.add()){
pp = dropdowns.add({stringList:app.pdfExportPresets.everyItem().name, selectedIndex:3, minWidth:80});
}
if(theDialog.show() == true){
pp = app.pdfExportPresets.item(pp.selectedIndex);
exportLayouts();
theDialog.destroy();
}
}
function exportLayouts(){
var doc = app.activeDocument
//gets an array of alternate layout names
var pr = doc.sections.everyItem().alternateLayout;
for (var i = 0; i < pr.length; i++){
app.pdfExportPreferences.properties = {pageRange:pr[i], viewPDF:false }
doc.exportFile(ExportFormat.pdfType, File(doc.filePath + "/" + pr[i] + ".pdf"), false, pp);
};
}