Book

A book.

Methods:

addEventListener, close, exportFile, extractLabel, getElements, insertLabel, packageForPrint, preflight, print, removeEventListener, repaginate, save, synchronize, toSource, toSpecifier, updateAllCrossReferences, updateAllNumbers, updateChapterAndParagraphNumbers

Objects:

BookContent, BookContents, Boolean, Document, EPubExportPreference, EPubFixedLayoutExportPreference, EventListeners, Events, File, Number, Object, Preferences, PreflightBookOption, PrintPreference, RepaginateOption, SmartMatchOptions, String,

Preferences:

EPubExportPreference, EPubFixedLayoutExportPreference, Preferences, PreflightBookOption, PrintPreference

Property Listing

Property

Type

Access

Description

automaticDocumentConversion

Boolean

read/write

If true, automatically converts the book content object during repagination and synchronization.

automaticPagination

Boolean

read/write

If true, automatically updates page numbers when pages in book content files are added, deleted, or rearranged.

bookContents

BookContents BookContent

readonly

A collection of book content objects.

epubExportPreferences

EPubExportPreference

readonly

EPub export preference settings.

epubFixedLayoutExportPreferences

EPubFixedLayoutExportPreference

readonly

EPub fixed layout export preference settings.

eventListeners

EventListeners EventListener

readonly

A collection of event listeners.

events

Events Event

readonly

A collection of events.

filePath

File

readonly

The full path to the file.

fullName

File

readonly

The full path to the Book, including the name of the Book.

index

Number

readonly

The index of the Book within its containing object.

insertBlankPage

Boolean

read/write

If true, inserts a blank page as necessary to fill in page number gaps caused by the odd or even specification set in the repagination option.

isValid

Boolean

readonly

Returns true if the object specifier resolves to valid objects.

label

String

read/write

A property that can be set to any string.

mergeIdenticalLayers

Boolean

read/write

If true, merges identically named layers when exporting to PDF.

modified

Boolean

readonly

If true, the Book has been modified since it was last saved.

name

String

readonly

The name of the Book.

parent

Application

readonly

The parent of the Book (a Application).

preferences

Preferences Preference

readonly

A collection of preferences objects.

preflightBookOptions

PreflightBookOption

readonly

Preflight book option settings.

printPreferences

PrintPreference

readonly

Print preference settings.

properties

Object

read/write

A property that allows setting of several properties at the same time.

repaginationOption

RepaginateOption

RepaginateOption.NEXT_EVEN_PAGE

RepaginateOption.NEXT_ODD_PAGE

RepaginateOption.NEXT_PAGE

read/write

Page numbering options for book content objects within the book.

saved

Boolean

readonly

If true, the Book has been saved since it was created.

smartMatchStyleGroups

SmartMatchOptions

SmartMatchOptions.MATCH_STYLE_NAME

SmartMatchOptions.MATCH_STYLE_PATH

read/write

How to match styles with same name while synchronizing a book.

styleSourceDocument

Document

BookContent

read/write

Current style source document. Can return: Document or BookContent.

synchronizeBulletNumberingList

Boolean

read/write

If true, synchronize bullets and numbering.

synchronizeCellStyle

Boolean

read/write

If true, synchronize cell styles.

synchronizeCharacterStyle

Boolean

read/write

If true, synchronize character styles.

synchronizeConditionalText

Boolean

read/write

If true, synchronize conditional text.

synchronizeCrossReferenceFormat

Boolean

read/write

If true, synchronize cross reference formats

synchronizeMasterPage

Boolean

read/write

If true, synchronize master pages.

synchronizeObjectStyle

Boolean

read/write

If true, synchronize object styles.

synchronizeParagraphStyle

Boolean

read/write

If true, synchronize paragraph styles.

synchronizeSwatch

Boolean

read/write

If true, synchronize swatches.

synchronizeTableOfContentStyle

Boolean

read/write

If true, synchronize table of content styles.

synchronizeTableStyle

Boolean

read/write

If true, synchronize table styles.

synchronizeTextVariable

Boolean

read/write

If true, synchronize text variables.

synchronizeTrapStyle

Boolean

read/write

If true, synchronize trap styles.

Method Listing

EventListener addEventListener (eventType:String, handler:Varies File JavaScriptFunction, [captures:Boolean=Boolean])

Adds an event listener.

Parameter

Type

Description

eventType

String

The event type.

handler

File

JavaScriptFunction

The event handler. Can accept: File or JavaScript Function.

captures

Boolean

This parameter is obsolete. (Optional)

(default: false)

undefined close ([saving:SaveOptions=SaveOptions], savingIn:File, versionComments:String, [forceSave:Boolean=Boolean])

Close the Book

Parameter

Type

Description

saving

SaveOptions

SaveOptions.ASK

SaveOptions.NO

SaveOptions.YES

Whether to save changes before closing the Book (Optional)

(default: SaveOptions.ASK)

savingIn

File

The file in which to save the Book (Optional)

versionComments

String

The comment for this version (Optional)

forceSave

Boolean

Forcibly save a version (Optional)

(default: false)

undefined exportFile (format:Varies ExportFormat String, to:File, [showingOptions:Boolean=Boolean], using:PDFExportPreset, whichDocuments:Array of BookContent, versionComments:String, [forceSave:Boolean=Boolean])

Exports the book to a file.

Parameter

Type

Description

format

ExportFormat

ExportFormat.EPS_TYPE

ExportFormat.EPUB

ExportFormat.FIXED_LAYOUT_EPUB

ExportFormat.HTML

ExportFormat.HTMLFXL

ExportFormat.INCOPY_MARKUP

ExportFormat.INDESIGN_MARKUP

ExportFormat.INDESIGN_SNIPPET

ExportFormat.INTERACTIVE_PDF

ExportFormat.JPG

ExportFormat.PDF_TYPE

ExportFormat.PNG_FORMAT

ExportFormat.RTF

ExportFormat.TAGGED_TEXT

ExportFormat.TEXT_TYPE

ExportFormat.XML

String

The export format, specified as an enumeration value or as an extension that appears in the Save as type or Format menu in the Export dialog. Can accept: ExportFormat enumerator or String.

to

File

The file to which to export the book. (Optional)

showingOptions

Boolean

Used to specify if the PDF Export Options Dialog needs to be shown or not (Optional)

(default: false)

using

PDFExportPreset

Used to specify the presets for the export which can be the object of the preset type, enumeration for existing presets or user defined presets, or a string naming the preset to be used, but in case Showing Options is true, the preset specified in the Export Dialog will over ride this parameter (Optional)

whichDocuments

Array of BookContent

Used to specify a list of book content references, from the current book, where the list may contain duplicate entries and if the list is not specified then the entire book contents shall be exported (Optional)

versionComments

String

The comment for this version. (Optional)

forceSave

Boolean

If true, forcibly saves a version. (Optional)

(default: false)

String extractLabel (key:String)

Gets the label value associated with the specified key.

Parameter

Type

Description

key

String

The key.

Book getElements ()

Resolves the object specifier, creating an array of object references.

undefined insertLabel (key:String, value:String)

Sets the label to the value associated with the specified key.

Parameter

Type

Description

key

String

The key.

value

String

The value.

Boolean packageForPrint (to:File, copyingFonts:Boolean, copyingLinkedGraphics:Boolean, copyingProfiles:Boolean, updatingGraphics:Boolean, includingHiddenLayers:Boolean, ignorePreflightErrors:Boolean, creatingReport:Boolean, includeIdml:Boolean, includePdf:Boolean, pdfStyle:String, useDocumentHyphenationExceptionsOnly:Boolean, versionComments:String, [forceSave:Boolean=Boolean])

Packages the document.

Parameter

Type

Description

to

File

The folder, alias, or path in which to place the packaged files.

copyingFonts

Boolean

If true, copies fonts used in the document to the package folder.

copyingLinkedGraphics

Boolean

If true, copies linked graphics files to the package folder.

copyingProfiles

Boolean

If true, copies color profiles to the package folder.

updatingGraphics

Boolean

If true, updates graphics links to the package folder.

includingHiddenLayers

Boolean

If true, copies fonts and links from hidden layers to the package.

ignorePreflightErrors

Boolean

If true, ignores preflight errors and proceeds with the packaging. If false, cancels the packaging when errors exist.

creatingReport

Boolean

If true, creates a package report that includes printing instructions, print settings, lists of fonts, links and required inks, and other information.

includeIdml

Boolean

If true, generates and includes IDML in the package folder. (Optional)

includePdf

Boolean

If true, generates and includes PDF in the package folder. (Optional)

pdfStyle

String

If specified and PDF is to be included, use this style for PDF export if it is valid, otherwise use the last used PDF preset. (Optional)

useDocumentHyphenationExceptionsOnly

Boolean

If this option is selected, InDesign flags this document so that it does not reflow when someone else opens or edits it on a computer that has different hyphenation and dictionary settings. (Optional)

versionComments

String

The comments for the version. (Optional)

forceSave

Boolean

If true, forcibly saves a version. (Optional)

(default: false)

undefined preflight (to:File, [autoOpen:Boolean=Boolean])

Preflight a book and optionally save the resulting report.

Parameter

Type

Description

to

File

The preflight report to save to. (Optional)

autoOpen

Boolean

If true, automatically open the report after creation. (Optional)

(default: false)

undefined print (printDialog:Boolean, using:Varies PrinterPresetTypes PrinterPreset)

Prints the Book(s).

Parameter

Type

Description

printDialog

Boolean

Whether to invoke the print dialog (Optional)

using

PrinterPresetTypes

PrinterPresetTypes.CUSTOM

PrinterPresetTypes.DEFAULT_VALUE

PrinterPreset

Printer preset to use. Can accept: PrinterPresetTypes enumerator or PrinterPreset. (Optional)

Boolean removeEventListener (eventType:String, handler:Varies File JavaScriptFunction, [captures:Boolean=Boolean])

Removes the event listener.

Parameter

Type

Description

eventType

String

The registered event type.

handler

File

JavaScriptFunction

The registered event handler. Can accept: File or JavaScript Function.

captures

Boolean

This parameter is obsolete. (Optional)

(default: false)

undefined repaginate ()

Repaginates the book.

undefined save (to:File, versionComments:String, [forceSave:Boolean=Boolean])

Saves the book.

Parameter

Type

Description

to

File

The file path. Note: Required only if the book has not been previously saved. If the book has previously been saved, specifying a path saves a copy and closes the original book. (Optional)

versionComments

String

The comment for this version. (Optional)

forceSave

Boolean

If true, forcibly saves a version. (Optional)

(default: false)

undefined synchronize ()

Synchronizes the entire book to the style source document.

String toSource ()

Generates a string which, if executed, will return the Book.

String toSpecifier ()

Retrieves the object specifier.

undefined updateAllCrossReferences ()

Updates the cross references in the entire book.

undefined updateAllNumbers ()

Update all numbers (e.g. Page numbers, chapter numbers and paragraph numbers) throughout the book.

undefined updateChapterAndParagraphNumbers ()

Updates chapter numbers and paragraph numbers throughout the book.

Object of

Application.activeBook

BookContent.parent

EPubExportPreference.parent

EPubFixedLayoutExportPreference.parent

Event.parent

EventListener.parent

MutationEvent.parent

Preference.parent

PreflightBookOption.parent

PrintPreference.parent

Return

Books.add()

Book.getElements()

Books.anyItem()

Books.everyItem()

Books.nextItem()

Books.previousItem()

Books.item()

Books.[]()

Books.itemByName()

Books.itemByRange()

Books.firstItem()

Books.lastItem()

Books.middleItem()