2022.2

Table Of Contents
Task See topic Field/function of sec-
tion object
Copy and add sections
dynamically
"Dynamicallyaddingsections(cloning)"onpage406.
clone()
Addaheadertoanemail "section"onpage848,examples:"AddingcustomESPhandling
instructions"onpage881.
headers
SetthemarginsofaPrint
sectionorMasterPage
"margins"onpage854
margins
SetaMaster Page,Media,
orDuplexprintingfora
Printsection
"sheetConfig"onpage831
sheetConfig
Repeatthesheetcon-
figurationafteranumberof
pages
"sheetConfig"onpage831
sheetConfig.positions.repeat
Dynamicallychangethe
page sizeofprintsections
andmedia
"section"onpage848,"media"onpage819
Note:WhenaControlScriptchangesthesizeofasection,it
shouldalsochangethesizeofthelinkedMedia;thisisnotdone
automatically.Whiletheoutputmaystilllookgood,asizemismatch
cancauseanissueifascriptoranothercomponentassumesthat
themediasizematchesthesectionsize.
Incaseofasizemismatchapreflightwillshowawarning(see
"DoingaPreflight"onpage378).
height,width
ControlScript:Pagenumbering
ThistopicexplainshowtowriteaControlScriptthatchangesthepagenumberinginPrintsections.
NotethatwhenyouaddaControlScript,italreadycontainsascripttomakethepagenumberingcon-
tinueoverallPrintsections.
ForinformationaboutControlScriptsingeneral,see"ControlScripts"onpage398and"ControlScript
API"onpage815.Ifyoudon'tknowhowtowritescripts,see"Writingyourownscripts"onpage368.
How to change page numbering in a control script
AControlScriptcanmakethepagenumberingcontinueoverallPrintsectionsorletitrestartonasec-
tion.ThisisdonebysettingtherestartPageNumber fieldonasectiontotrueorfalse.
Forexample:merge.template.contexts.PRINT.sections['Section
2'].restartPageNumber = true;.(Alsosee"section"onpage848and"ControlScriptAPI"on
page815.)
Pagenumberingstartswithpage1foreachsection.IfforasectionrestartPageNumberissetto
false,thatsectionwillstartwiththepagenumberfollowingthelastpageoftheprevioussection.
Page 400