Skip to main content
Participating Frequently
January 5, 2011
Answered

Export documents inside an InDesign book in a single PDF file

  • January 5, 2011
  • 2 replies
  • 705 views

I have several documents inside an InDesign book. Is there a way that they can be exported into one single PDF file?

Here is the script I am using:

    for (var i = 0; i < data.chapters.length; i++)
       {
            show_list.children[0].selection = i; show_list.show ();
           
            DocName = data.chapters.name;
          
            app.open (data.chapters, false);
           
            f = new File (data.chapters.fullName.replace (/indd$/, "pdf"));

            app.pdfExportPreferences.pageRange = PageRange.allPages;
            app.documents.itemByName(DocName).exportFile(ExportFormat.pdfType, f, false, data.preset);
            app.documents.itemByName(DocName).close(SaveOptions.no);
       }

The script exports them to PDF but each document is a separate PDF file.

Any hep would be appreciated.  Thanks. 

This topic has been closed for replies.
Correct answer Harbs.

Check out Book.exportFile()...

Harbs

2 replies

Peter Kahrel
Community Expert
Community Expert
January 5, 2011

I wrote that script because InDesign's Book doesn't have an option to export book files individually. Instead, Book export always gives you one combined file. So either you don't need a script (simply export the book in the UI) or, as Harbs said, all you need to do is find the script command for exporting a book.

Peter

Participating Frequently
January 6, 2011

Thanks Harbs and Peter!  I was able to use book.exportFile for my script.

And Peter your scripts have been a great help. 

Harbs.
Harbs.Correct answer
Legend
January 5, 2011

Check out Book.exportFile()...

Harbs