• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

How to export pages as a spread in PDF ?

Explorer ,
Dec 01, 2018 Dec 01, 2018

Copy link to clipboard

Copied

Hello,

I'm trying to export my document spreads to a PDF file as a spread using below code:

app.pdfExportPreferences.exportReaderSpreads = true;

but Indesign completly ignores setting the property, and saves a single paged PDF !!

I'm wondering, where is the catch ... šŸ™‚ ?

Thanks  in advance for any help or suggestion.

Regards,

Marcin

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
Contributor ,
Dec 01, 2018 Dec 01, 2018

Copy link to clipboard

Copied

Hi platm,

     just try in another way, may it works,

var myDoc = app.documents[0];

var FilePath = "Your File Saving Path";

with(app.pdfExportPreferences){

      exportReaderSpreads = true;

}

myDoc.exportFile(ExportFormat.PDF_TYPE, File(FilePath+"/PrintPDF.pdf"), false);

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
Community Expert ,
Dec 02, 2018 Dec 02, 2018

Copy link to clipboard

Copied

Hi Marcin,

Works fine for me, can you share the code that you are using and InDesign version that you are using. I tried on CC2017 MAC and it worked.

-Manan

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
Community Expert ,
Dec 02, 2018 Dec 02, 2018

Copy link to clipboard

Copied

This works for me:

app.pdfExportPreferences.pageRange = PageRange.ALL_PAGES;

app.pdfExportPreferences.exportReaderSpreads = true;

myPdf = File (...)

app.documents[0].exportFile (ExportFormat.PDF_TYPE, myPdf);

Maybe try adding line 1 to your code.

There is something wrong with PDF export though: usually when you set the export settings with a script, those settings are sticky in that you see them when you next manually export an indd to pdf. But the 'Export as spreads' button isn't selected after setting it. Another way to see that is by using this line instead of line 4:

app.documents[0].exportFile (ExportFormat.PDF_TYPE, myPdf, true);

This opens the PDF Export dialog and 'Spreads' should have been selected, but it isn't. But as I mentioned, spread export does work over here.

P.

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
Explorer ,
Dec 02, 2018 Dec 02, 2018

Copy link to clipboard

Copied

Hi everybody šŸ™‚

thank you for your attention and all the advise !!

Thank them I understood where I am making a mistake !

My script exports PDF using this code:

doc.exportFile( ExportFormat.pdfType, pdfFile, false, selectedPDFPreset );

so, the selectedPDFpreset overrides the application property exportReaderSpreads.

It is so obvious .... now šŸ™‚

Thank you again and excuse me my misunderstanding of the problem origin.

BTW: what is the practical diference between exportFile and asynchronousExportFile method ?

Best regards

Marcin

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
Explorer ,
Dec 02, 2018 Dec 02, 2018

Copy link to clipboard

Copied

I've changed my method. Now the method looks for property  exportReaderSpreads of pdfExportPreset insted of pdfExportPreference and it works perfect šŸ™‚

Thanks again šŸ™‚

Regards

Marcin

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
Community Expert ,
Dec 02, 2018 Dec 02, 2018

Copy link to clipboard

Copied

platm72  wrote

ā€¦ BTW: what is the practical diference between exportFile and asynchronousExportFile method ?

Hi Marcin,

with asynchronous export you do this as background process.

That's the default with InDesign since CS5.

The "old" exportFile is a "foreground" process where you have to wait until the process is done until you can do other things with InDesign. You'll see a progress bar until the process is finished telling what page is exported, if data is handled like placed images and so on.

Just test this!

BTW: With a one page document you'll hardly will see the progress bar, because it's so fast finishing export.

Regards,
Uwe

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
Explorer ,
Dec 06, 2018 Dec 06, 2018

Copy link to clipboard

Copied

LATEST

Thank you Uwe,

for a very helpful answer :-).

Usually, I use my scrtipt to make multipage PDF-s, or single-page PDF-s from multipage Indd documents, so I will try this option for sure :-).

Many Regards,

Marcin

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