just try in another way, may it works,
var myDoc = app.documents;
var FilePath = "Your File Saving Path";
exportReaderSpreads = true;
myDoc.exportFile(ExportFormat.PDF_TYPE, File(FilePath+"/PrintPDF.pdf"), false);
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.
This works for me:
app.pdfExportPreferences.pageRange = PageRange.ALL_PAGES; app.pdfExportPreferences.exportReaderSpreads = true; myPdf = File (...) app.documents.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.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.
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 ?
I've changed my method. Now the method looks for property exportReaderSpreads of pdfExportPreset insted of pdfExportPreference and it works perfect :-)
Thanks again :-)
platm72 wrote… BTW: what is the practical diference between exportFile and asynchronousExportFile method ?
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.
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 :-).