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
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);
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
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.
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
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
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
Copy link to clipboard
Copied
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