2022.2

Table Of Contents
Function Description
"query(selector)"
onpage843
RunsaqueryacrossallsectionsinthePrintcontext.ThisfunctionisonlyavailableinPostPaginationScripts,whichareonly
appliedtothePrintcontext.See"PostPaginationScripts"onpage410.
Example
ThisscriptchecksiftheoutputchannelisEMAILandifthecontexttobemergedisthePrintcontext
(whichhappensifthePrintcontextisattachedtoanemail).Ifthisisthecase,itincludesandexcludes
certainPrintsectionsfromtheoutput.
if (channel == Channel.EMAIL) {
if (merge.context.type == ContextType.PRINT) {
merge.context.sections['Section 1'].enabled = false;
merge.context.sections['Section 2'].enabled = false;
merge.context.sections['Section 3'].enabled = true;
}
}
masterpage
ThemasterpageobjectisusedtosetaMasterPage'sheaderandfooterortoreplaceitsentireHTML
body.ItcanonlybeaccessedinControlScripts(see"ControlScripts"onpage398and"ControlScript
API"onpage815).Tryingtoaccessitinanothertypeofscriptwillresultinanerror.
NotethatMasterPagesareonlyusedinaPrintcontext(see"MasterPages"onpage141).
Inscript,MasterPagesareretrievedviathemasterpagesArraywhichcontainsallMasterPagesinthe
currenttemplate(see"template"onpage835).
Forexample:
var myMasterpage = merge.template.masterpages["Master page 1"];.
Functions and fields
Field Type Description
"html()"on
page834
GetsorsetstheHTMLofthebodyelement.
"margins"on
page854
Margins AllowstosettheheaderandfooterofaMasterPage,usingaMeasurementstring,forexample:"2in"
(thissetsamargintotwoinches).
Page 816