2022.2

Table Of Contents
l
PostPaginationScriptsrunafterallotherscripts,moreprecisely:afterthecontenthasbeen
paginated.ThepaginationprocessappliespagebreakstothecontentofaPrintsection,adds
MasterPagesandsetstheMedia.APostPaginationScriptmayquerytherendereddocument
andcollectinformationaboutelements(forinstance,onwhichpagetheyresideon)andsections
(forinstance,whethertheyareenabled).Ifneeded,aPostPaginationScriptcanchangethe
sheetconfigurationandre-paginateasection.
l
PostPaginationScriptsonlyapplytothePrintcontext.Theoutputofothercontextsisnotpagin-
ated.
JustlikeStandardScripts,PostPaginationScriptshaveaselector(see:"SelectorsinOLConnect"on
page825).Aselectorselectspartsofthecontentofasectionandstoresthemintheresultsobject,
sothattheycanbemodifiedinthescript(see"results"onpage1301).
ThesecondmostimportantobjectinaPostPaginationScript,justlikeinaControlScript,isasection
(see"section"onpage1305).
WhattouseaPostPaginationScriptfor
AfterallPrintsectionshavebeenpaginated,PostPaginationScriptsmaysearchthroughtherendered
documentandcollectinformationaboutelements(forinstance,whichpagetheyresideon)andsec-
tions(forinstance,whethertheyareenabled).Withthisinformation,aPostPaginationScriptcando
twothings:
l
Modify the output.Thescriptmaymodifytheoutputofasection.Itcould,forexample,use
informationlikepagenumberstocreateaTableOfContents(TOC),asexplainedinthetopic:
"CreatingaTableOfContents"onthefacingpage.Ifneeded,aPostPaginationScriptcan
changethesheetconfigurationandre-paginatethesection(see"paginate()"onpage1312.
l
Add information to the Connect database.Thescriptmayaddproductioninformation,such
asthepage,sizeorpositionofelementsafteramerge,ascustompropertiestoaPrintContent
ItemintheConnectdatabase(see"contentitem"onpage1298).Custompropertiescanbeutil-
izedforfurtherprocessinginaWorkflowconfigurationwiththeRetrieveItemstask.TheRetrieve
Itemstaskretrievescustompropertiesalongwiththebaserecordinformation(seeRetrieve
ItemsinWorkflow'sOnlineHelp).
AddingaPostPaginationScript
ToaddaPostPaginationScript:
1. OntheScriptspaneatthebottomleft,clicktheblacktriangleontheNewbuttonandclickPost
Pagination Script.ThenewscriptappearsinthePostPaginationfolder.
2. Double-clickthenewscripttoopenit.Thescripteditorappears.
3. Changethenameofthescriptsothatitreflectswhatthescriptdoes.
Page 851