• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Export PDF as spreads with single page preset

Guest
Mar 15, 2018 Mar 15, 2018

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

TOPICS
Scripting

Views

1.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Mar 17, 2018 Mar 17, 2018

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

Votes

Translate

Translate
Enthusiast ,
Mar 17, 2018 Mar 17, 2018

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!)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Mar 17, 2018 Mar 17, 2018

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 19, 2018 Mar 19, 2018

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines