Setting pagination options via a script

The options shown on the “Paginate” dialog can all be set using the ‘setPaginationOption‘ scripting method which is available on the datasource object.  This method takes two parameters: the name of the option to set and the value to set it to.

The value used for the ‘name‘ parameter can be determined by examining the ‘Pagination.xml‘ file for any EasyCatalog data source:

The ‘paginationtype‘ attribute is used to determine the type of pagination (e.g. “Into Text Flow“, “Guide-Based“, etc) that will be used by the ‘paginateUsingDefaults‘ method:

0. Into Text Flow
1. At Positions Specified In The Data
2. At Page Guide Positions
3. Using Master Pages
7. Template Document

To determine the values to  set for the other attributes, manually paginate using the EasyCatalog user interface and then examine the changes that were made to the ‘Pagination.xml‘ configuration file.

Once the defaults have been specified by your script, use the ‘paginateUsingDefaults‘ method e.g.:

For pagination types that require a library, this can be specified in the first parameter:

To target a specific document, this can be specified in the second parameter:

or, for pagination types that do not require a library: