Adobe InDesign CS6 (8.0) Object Model JS: Book

InDesign CS6

Class

Book

 A book.

QuickLinks

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

Hierarchy

Application
Book
BookContent | EPubExportPreference | Event | EventListener | MutationEvent | Preference | PreflightBookOption | PrintPreference

Properties

PropertyTypeAccessDescription
automaticDocumentConversionbool r/wIf true, automatically converts the book content object during repagination and synchronization.
automaticPaginationbool r/wIf true, automatically updates page numbers when pages in book content files are added, deleted, or rearranged.
bookContentsBookContents readonlyA collection of book content objects.
epubExportPreferencesEPubExportPreference readonlyEPub export preference settings.
eventListenersEventListeners readonlyA collection of event listeners.
eventsEvents readonlyA collection of events.
filePathFile readonlyThe full path to the file.
fullNameFile readonlyThe full path to the Book, including the name of the Book.
indexnumber readonlyThe index of the Book within its containing object.
insertBlankPagebool r/wIf 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.
isValidbool readonlyReturns true if the object specifier resolves to valid objects.
labelstring r/wA property that can be set to any string.
mergeIdenticalLayersbool r/wIf true, merges identically named layers when exporting to PDF.
modifiedbool readonlyIf true, the Book has been modified since it was last saved.
namestring readonlyThe name of the Book.
parentApplication readonlyThe parent of the Book (a Application).
preferencesPreferences readonlyA collection of preferences objects.
preflightBookOptionsPreflightBookOption readonlyPreflight book option settings.
printPreferencesPrintPreference readonlyPrint preference settings.
propertiesObject r/wA property that allows setting of several properties at the same time.
repaginationOptionRepaginateOption:
RepaginateOption.NEXT_PAGE
RepaginateOption.NEXT_ODD_PAGE
RepaginateOption.NEXT_EVEN_PAGE
r/wPage numbering options for book content objects within the book.
savedbool readonlyIf true, the Book has been saved since it was created.
smartMatchStyleGroupsSmartMatchOptions:
SmartMatchOptions.MATCH_STYLE_PATH
SmartMatchOptions.MATCH_STYLE_NAME
r/wHow to match styles with same name while synchronizing a book.
styleSourceDocumentBookContent
Document
r/wCurrent style source document. Can return: Document or BookContent.
synchronizeBulletNumberingListbool r/wIf true, synchronize bullets and numbering.
synchronizeCellStylebool r/wIf true, synchronize cell styles.
synchronizeCharacterStylebool r/wIf true, synchronize character styles.
synchronizeConditionalTextbool r/wIf true, synchronize conditional text.
synchronizeMasterPagebool r/wIf true, synchronize master pages.
synchronizeObjectStylebool r/wIf true, synchronize object styles.
synchronizeParagraphStylebool r/wIf true, synchronize paragraph styles.
synchronizeSwatchbool r/wIf true, synchronize swatches.
synchronizeTableOfContentStylebool r/wIf true, synchronize table of content styles.
synchronizeTableStylebool r/wIf true, synchronize table styles.
synchronizeTextVariablebool r/wIf true, synchronize text variables.
synchronizeTrapStylebool r/wIf true, synchronize trap styles.

Methods

Instances

EventListener addEventListener (eventType: string, handler: varies[, captures: bool=false])
Adds an event listener.

ParameterTypeDescription
eventTypestringThe event type.
handlerFile
JavaScript Function
The event handler. Can accept: File or JavaScript Function.
capturesboolThis parameter is obsolete. (Optional) (default: false)

void close ([saving: SaveOptions=SaveOptions.ASK][, savingIn: File][, versionComments: string][, forceSave: bool=false])
Close the Book

ParameterTypeDescription
savingSaveOptions:
SaveOptions.NO
SaveOptions.ASK
SaveOptions.YES
Whether to save changes before closing the Book (Optional) (default: SaveOptions.ASK)
savingInFileThe file in which to save the Book (Optional)
versionCommentsstringThe comment for this version (Optional)
forceSaveboolForcibly save a version (Optional) (default: false)

void exportFile (format: varies[, to: File][, showingOptions: bool=false][, using: PDFExportPreset][, whichDocuments: Array of BookContent][, versionComments: string][, forceSave: bool=false])
Exports the book to a file.

ParameterTypeDescription
formatExportFormat
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.
toFileThe file to which to export the book. (Optional)
showingOptionsboolUsed to specify if the PDF Export Options Dialog needs to be shown or not (Optional) (default: false)
usingPDFExportPresetUsed 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)
whichDocumentsArray of BookContentUsed 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)
versionCommentsstringThe comment for this version. (Optional)
forceSaveboolIf true, forcibly saves a version. (Optional) (default: false)

string extractLabel (key: string)
Gets the label value associated with the specified key.

ParameterTypeDescription
keystringThe key.

Array of Book getElements ()
Resolves the object specifier, creating an array of object references.

void insertLabel (key: string, value: string)
Sets the label to the value associated with the specified key.

ParameterTypeDescription
keystringThe key.
valuestringThe value.

bool packageForPrint (to: File, copyingFonts: bool, copyingLinkedGraphics: bool, copyingProfiles: bool, updatingGraphics: bool, includingHiddenLayers: bool, ignorePreflightErrors: bool, creatingReport: bool[, versionComments: string][, forceSave: bool=false])
Packages the document.

ParameterTypeDescription
toFileThe folder, alias, or path in which to place the packaged files.
copyingFontsboolIf true, copies fonts used in the document to the package folder.
copyingLinkedGraphicsboolIf true, copies linked graphics files to the package folder.
copyingProfilesboolIf true, copies color profiles to the package folder.
updatingGraphicsboolIf true, updates graphics links to the package folder.
includingHiddenLayersboolIf true, copies fonts and links from hidden layers to the package.
ignorePreflightErrorsboolIf true, ignores preflight errors and proceeds with the packaging. If false, cancels the packaging when errors exist.
creatingReportboolIf true, creates a package report that includes printing instructions, print settings, lists of fonts, links and required inks, and other information.
versionCommentsstringThe comments for the version. (Optional)
forceSaveboolIf true, forcibly saves a version. (Optional) (default: false)

void preflight ([to: File][, autoOpen: bool=false])
Preflight a book and optionally save the resulting report.

ParameterTypeDescription
toFileThe preflight report to save to. (Optional)
autoOpenboolIf true, automatically open the report after creation. (Optional) (default: false)

void print ([printDialog: bool][, using: varies])
Prints the Book(s).

ParameterTypeDescription
printDialogboolWhether to invoke the print dialog (Optional)
usingPrinterPreset
PrinterPresetTypes
Printer preset to use. Can accept: PrinterPresetTypes enumerator or PrinterPreset. (Optional)

bool removeEventListener (eventType: string, handler: varies[, captures: bool=false])
Removes the event listener.

ParameterTypeDescription
eventTypestringThe registered event type.
handlerFile
JavaScript Function
The registered event handler. Can accept: File or JavaScript Function.
capturesboolThis parameter is obsolete. (Optional) (default: false)

void repaginate ()
Repaginates the book.

void save ([to: File][, versionComments: string][, forceSave: bool=false])
Saves the book.

ParameterTypeDescription
toFileThe 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)
versionCommentsstringThe comment for this version. (Optional)
forceSaveboolIf true, forcibly saves a version. (Optional) (default: false)

void 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.

void updateAllCrossReferences ()
Updates the cross references in the entire book.

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

void updateChapterAndParagraphNumbers ()
Updates chapter numbers and paragraph numbers throughout the book.

Element of

Application.activeBook

BookContent.parent

EPubExportPreference.parent

PreflightBookOption.parent

PrintPreference.parent

Used in:

Book Books.nextItem (obj: Book)

Book Books.previousItem (obj: Book)

array of Story Document.createTOC (using: TOCStyle[, replacing: bool=false][, fromBook: Book][, placePoint: Array of Measurement Unit (Number or String)][, includeOverset: bool=false][, destinationLayer: Layer])

Return

Array of Book Book.getElements ()

Book Books.[] (index: number)

Book Books.add (fullName: File[, withProperties: Object])

Book Books.anyItem ()

Array of Book Books.everyItem ()

Book Books.firstItem ()

Book Books.item (index: varies)

Book Books.itemByName (name: string)

Array of Book Books.itemByRange (from: varies, to: varies)

Book Books.lastItem ()

Book Books.middleItem ()

Book Books.nextItem (obj: Book)

Book Books.previousItem (obj: Book)

Jongware, 28-Apr-2012 v3.0.3hContents :: Index