2022.2

Table Of Contents
Setting the header and footer of a Master Page
var masterA = merge.template.masterpages["Master page A"];
masterA.margins.header = "2in";
masterA.margins.footer = "2in";
paginate()
Thismethodofthesectionobject(see"section"onpage848)triggerspaginationofthecurrentsec-
tion.Thepaginationprocessre-establishespageboundaries,updatespagenumbersandpagecounts,
andreappliesMasterPages.
Dependingonwhetherpagenumberingrestartsineachsectionthismayaffectthepagenumbersin
othersectionsaswell(see"Configuringpagenumbers"onpage137).
Whenthepaginationprocesshasended,thescriptresumes.
The'currentsection'isalwaysaPrintsection,sincethismethodcanonlybeusedinPostPagination
Scripts,andPostPaginationScriptsonlyrunonthePrintcontext(see"PostPaginationScripts"on
page410).
Youonlyneedtocallmerge.section.paginate()inaPostPaginationScriptifthescripthas
addedorremovedcontenttosuchanextentthatthepageboundariesneedtoberenewed.
Foranexamplesee:"CreatingaTableOfContents"onpage411.
Pagination
ThePaginationobjectthatisaccessedviathesectionobject(see"section"onpage848)contains
thetotalpagecount,sheetcountandstart/endpagenumbersforasingle section.Theseproperties
areread-onlyandareonlyavailableinPostPaginationScripts(see"PostPaginationScripts"on
page410).
Forthetotalpageandsheetcountofall Print sectionstogetherusethemergeobject's"Pagination"
onpage857(seealso:"merge"onthefacingpage).
Forinformationaboutwhereanelementislocatedandthecountsofpagesandsheetsinapage
bundle-agroupofsectionsinwhichthepagenumberingcontinues-use"info()"onpage847.
Field Type Description
pageCount
Number
The total number of pages in this section.
pageEnd
Number Theindex(1-based)ofthelastpageinthissection.
pageStart
Number Theindex(1-based)ofthefirstpageinthissection.
Page 854