7 Replies Latest reply on Sep 8, 2011 10:07 AM by lhanneman

    [CS5][JS] Efficiently export 100+ page book as PDF?

    lhanneman Level 1

      Hello,

       

      I'm creating an InDesign Book via javascript, and this book will contain more than 100 single page InDesign Documents. My script to create the book works fine - but takes anywhere from 5-8 minutes to run.

       

      However, when I run my script to open that book and export as a PDF, it takes 10+ minutes just to export the PDF, and then it times out on our InDesign Development server. I'm wondering if I can more efficiently write my script to create the book, as well as my script to export the book as a PDF. Both scripts are very simple:

       

      CreateInDesignBook();

      function CreateInDesignBook(){


          var myBook = app.books.add('c:/myBook.indb');


          myBook.bookContents.add('file_1.indd');

          myBook.bookContents.add('file_2.indd');

          // and so on, with potentially 100-200 more .indd files added


          myBook.close(SaveOptions.YES);


      }

      --------------------------------------------------

      ExportInDesignBook();

      function ExportInDesignBook(){


          var myBook = app.open('c:/myBook.indb');


          var myFile = new File('myPDF.pdf');

          myBook.exportFile(ExportFormat.pdfType, myFile, false, app.pdfExportPresets.item('[Smallest File Size]'));


          myBook.close(SaveOptions.NO);


      }

       

      Thanks in advance for any help/advice!

       

      -Lloyd

        • 1. Re: [CS5][JS] Efficiently export 100+ page book as PDF?
          lhanneman Level 1

          As for creating my book, I have found that if I create the single Indesign pages (each contain a page-size PDF) in increments of 50 pages per document (so could have 3 documents of 50 pages each getting added to my book), the books are created MUCH faster (less than a minute). However, exporting that book as a PDF still took roughly 11 minutes.

           

          Does anyone know if there is a faster way to export this? I'm just trying to avoid time-outs on the server. Is there a way I could add pages/documents to an existing PDF (instead of exporting the entire book/document as one PDF)? If that were the case I could just add 50 pages at a time to the PDF and maybe not even need the book anymore?

           

          Ultimately, I just need an efficient way to get all pages into a single PDF.

           

          Thanks in advance for any help!

          • 2. Re: [CS5][JS] Efficiently export 100+ page book as PDF?
            Laubender Adobe Community Professional & MVP

            Ihanneman,

            if you use Acrobat 9 Pro you easily can combine all your PDFs into one file. Go to:


            File / Combine / Merge Files into a Single PDF

             

            If you use Acrobat X Pro go to:

             

            File / Create / Combine Files into a Single PDF


            From then on it's quite self-explanatory…

             

             

            Uwe

            1 person found this helpful
            • 3. Re: [CS5][JS] Efficiently export 100+ page book as PDF?
              lhanneman Level 1

              Thanks for the reply!

               

              I think I read something about using Acrobat as well, however, I'll need a way to automate this using InDesign Server and scripting, so Acrobat won't be an option.

              • 4. Re: [CS5][JS] Efficiently export 100+ page book as PDF?
                absqua Level 4

                Do your pages contain anything but a page-size pdf? If not—if your goal is simply to combine single-page pdfs into a larger, multi-page pdf—why use InDesign at all?

                 

                I don't know what your workflow looks like, but on Mac/*nix, I would use something like pdftk for this.

                 

                I assume there's some way to run a command-line program from VBScript? I don't know. If there is, and if your pages contain InDesign content as well as placed pdfs, you could export each page/document to pdf, and then combine the new pdfs with your existing multi-page pdf by shelling out to pdftk or something similar.

                 

                Jeff

                • 5. Re: [CS5][JS] Efficiently export 100+ page book as PDF?
                  lhanneman Level 1

                  Correct, nothing but a single PDF on each page. However, the pages are originally built with InDesign because several pages might contain multiple PDFs, then each page is exported as a single PDF. Then when we have our "page" PDFs they can be arranged and brought back into InDesign to make a book. Our entired workflow revolves around InDesign/InDesign server, thats why I'm using our ID Server to export the PDFs via javascript - it's just a little slow!

                  • 6. Re: [CS5][JS] Efficiently export 100+ page book as PDF?
                    Laubender Adobe Community Professional & MVP

                    Ihanneman,

                    why not expanding the time-out of your server?

                     

                    Uwe

                    • 7. Re: [CS5][JS] Efficiently export 100+ page book as PDF?
                      lhanneman Level 1

                      My solution to this is to create my single page documents in increments of 25. So for 100 pages, I'll have 4 documents. These can be added to a book much faster, and the export also seems much quicker!