2022.2

Table Of Contents
1. SectionA(1page)restartPageNumber=true
2. SectionB(2pages)restartPageNumber=false
3. SectionC(3pages)restartPageNumber=true,enabled=false
4. SectionD(4pages)restartPageNumber=false
Incode:
if (merge.context.type == ContextType.PRINT) {
merge.context.sections['Section A'].restartPageNumber = true;
merge.context.sections['Section B'].restartPageNumber = false;
merge.context.sections['Section C'].restartPageNumber = true;
merge.context.sections['Section C'].enabled = false;
merge.context.sections['Section D'].restartPageNumber = false;
}
Thepagenumberingintheoutputwillbe:
1. SectionApage1
2. SectionBpage2
3. SectionDpage1(pagenumberingisrestartedduetosectionC'srestartPageNumber=true)
Parts:splittingandrenamingemailattachments
InaControlScript,partscanbedefinedtodeterminewhichsectionsshouldbeoutputtothesamefile.
ThiswayitispossibletosplitthePrintcontextintomultipleemailattachments.Thistopicshowshowto
dothat.
ForinformationaboutControlScriptsingeneral,see"ControlScripts"onpage398and"ControlScript
API"onpage815.Ifyoudon'tknowhowtowritescripts,see"Writingyourownscripts"onpage368.
Defining parts
Definingpartsisdonebysettingthepartfieldonasection,forexample:
merge.template.contexts.PRINT.sections['Section 2'].part = "PDF_Attachment2";.
(Alsosee"section"onpage848and"ControlScriptAPI"onpage815.)
l
Ifapartnameisgiven,thenthatdelimitsthestartofanewpart(evenifthepartnameisthesame
asthepreviousone).Followingsectionsthatdon'tdefineapartname,willbeaddedtothepre-
viouspart.
Page 402