7 Replies Latest reply on Dec 6, 2018 11:28 AM by platm72

    How to export pages as a spread in PDF ?

    platm72 Level 1

      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

        • 1. Re: How to export pages as a spread in PDF ?
          payalm68947498 Level 2

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

          • 2. Re: How to export pages as a spread in PDF ?
            Manan Joshi Adobe Community Professional

            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

            • 3. Re: How to export pages as a spread in PDF ?
              Peter Kahrel Adobe Community Professional & MVP

              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.

              • 4. Re: How to export pages as a spread in PDF ?
                platm72 Level 1

                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

                • 5. Re: How to export pages as a spread in PDF ?
                  platm72 Level 1

                  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

                  • 6. Re: How to export pages as a spread in PDF ?
                    Laubender Adobe Community Professional & MVP

                    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

                    • 7. Re: How to export pages as a spread in PDF ?
                      platm72 Level 1

                      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