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.
1 | myDS.setPaginationOption("templatedocumentpath","Macintosh HD:mytemplate.indd"); |
The value used for the ‘name‘ parameter can be determined by examining the ‘Pagination.xml‘ file for any EasyCatalog data source:
1 2 3 4 5 6 7 | <pagination assettype="0" paginationtype="0" assetfield="" usegeometry="false" paginationlogic="1" librarylocation="" rulesetname="" insertpages="true" undosupport="true" continueonerror="false" optimizedcopy="false" masterpaginationtype="0"> <positional pagenumberfield="" xfieldname="" yfieldname="" widthfield="" heightfield="" xsystem="4609" ysystem="4609" widthsystem="4609" heightsystem="4609" paginateinposition="714014720" positionalmasterfield=""/> <guide flowdirection="0" guidestyleisgroups="false" collisiondetection="false" collisionoffset="0" continueatnextpositionifitemdoesntfit="false" ignorepagebounds="false" guideassetfield="" guidemasterfield="" guidebreakonfield="" guidebreakonfieldbreaktype="0" guiderestrictverticalmergetopagebounds="false"/> <flow flowbasedstylename="" restrictverticalmergetopagebounds="false" autoapplyparaspacebefore="false" flowbreakonfield="" flowbreakonfieldbreaktype="0" flowprocessfurnitureduringpagination="false"/> <special pskeyfieldname=""/><template templatedocumentpath="" templatedocumentgroupname="" templatedocumentoutputpath="" templatedocumentoutputfilename="" templatedocumentpdfpreset="" templatedocumentcollatedocumentsinbook="false" templatedocumentprint="false" templatedocumentprintpreset="" templateoutputpdf="true" templateoutputdocument="true"/> <master masterstylefield="" mastergroupname="" masterpositiongroupmatch="" masterpagenumberfield="" masterquantityfield="" masterpositionindexfield="" masterlayernamefield=""/><importtemplate importtemplateusecurrentpage="true" importtemplateuseidmsroot="true" importtemplateidmsroot="" importtemplatefieldname="" importtemplatemasterfieldname="" importtemplatedontpopulate="false" importtemplateimporttype="0"/> </pagination> |
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.:
1 | myTempDV.paginateUsingDefaults(); |
For pagination types that require a library, this can be specified in the first parameter:
1 | myTempDV.paginateUsingDefaults(File(myLibraryLocation)); |
To target a specific document, this can be specified in the second parameter:
1 | myTempDV.paginateUsingDefaults(File(myLibraryLocation), myDoc); |
or, for pagination types that do not require a library:
1 | myTempDV.paginateUsingDefaults(File(), myDoc); |