Copy link to clipboard
Copied
Hi All, not sure if what I'm asking for is possible but thought it was worth asking the question
The script below exports a "lo-res, single page PDF" to the desktop, I would like it to export as spreads but without having to create a duplicate preset with that one difference as I have loads of presets and want to avoid doubling up on all of them with the word "Spread" at the end.
I thought this may be possible by setting up the second line something like:
var _PDFExportPreset = app.pdfExportPresets.item('[Smallest File Size]',(exportReaderSpreads = true));
but it doesn't work, I have tried quite a few variations but with no luck, any help would be appreciated.
// Export lo-res PDF to Desktop
var _PDFfile = new File('~/Desktop/test.pdf');
var _PDFExportPreset = app.pdfExportPresets.item('[Smallest File Size]');
app.pdfExportPreferences.pageRange = PageRange.ALL_PAGES;
app.activeDocument.exportFile(ExportFormat.pdfType, _PDFfile, false,_PDFExportPreset);
Thanks, Bren
Try this:
// Export per spread lo-res PDF to Desktop
var _PDFfile = new File('~/Desktop/test_spreads.pdf');
var _PDFExportPreset = app.pdfExportPresets.item('[Smallest File Size]');
_PDFExportPreset.exportReaderSpreads = true;
app.pdfExportPreferences.pageRange = PageRange.ALL_PAGES;
app.activeDocument.exportFile(ExportFormat.pdfType, _PDFfile, false,_PDFExportPreset);
_PDFExportPreset.exportReaderSpreads = false;
Best,
Michel, from FRIdNGE
Copy link to clipboard
Copied
Hi Bren,
The idea is to set the pdf page layout property of the preset to ExtendScript's corresponding for one of the following:
two up facing, two up facing continuous, or two up cover page continuous
Do this before the export, then reset the property back to default when done.
Here it is in AppleScript
set filePath to (path to desktop from user domain) as string
set fileRef to filePath & "TestPDFOutput3.pdf"
tell application "Adobe InDesign CC 2018"
set thePreset to PDF export preset "[Smallest File Size]"
tell thePreset
set pdf page layout to two up facing
end tell
export document 1 to fileRef format PDF type using thePreset
tell thePreset
set pdf page layout to default
end tell
end tell
(Sorry, but ExtendScript toolkit is giving me fits!)
Copy link to clipboard
Copied
Try this:
// Export per spread lo-res PDF to Desktop
var _PDFfile = new File('~/Desktop/test_spreads.pdf');
var _PDFExportPreset = app.pdfExportPresets.item('[Smallest File Size]');
_PDFExportPreset.exportReaderSpreads = true;
app.pdfExportPreferences.pageRange = PageRange.ALL_PAGES;
app.activeDocument.exportFile(ExportFormat.pdfType, _PDFfile, false,_PDFExportPreset);
_PDFExportPreset.exportReaderSpreads = false;
Best,
Michel, from FRIdNGE
Copy link to clipboard
Copied
Thanks Michel,
That has worked perfectly, I have had to change the [Smallest File Size] preset to one of the presets that I have created as it is a default and cannot be changed but that has worked with no problems.
and Thank You also S.Hopkins, it sounds like you both went down the same lines of changing the preset then reverting it, I have just never used AppleScript so have stuck with the Java for now.
Thank you both for your help , Bren