2022.2

Table Of Contents
html(value)
Replacesthecontentsofthe<body>ofasectionorMasterPagewiththesuppliedvalue.Thisfunction
isonlyavailableinControlScripts.Seealso:"section"onpage1305and"masterpage"onpage1274.
value
AStringthatmaycontainHTMLtags.
Examples
Thefollowingscriptuseshtml()toretrievethecontentsofasectionandaddaparagraphtoit.
var foo = merge.context.sections["Section 1"].html();
foo += "<p>hello world</p>";
merge.context.sections["Section 1"].html( foo );
Thefollowingscriptloadsasnippetbasedonthevalueofafield,andthenreplacesthecontentofa
Printsectionwiththesnippetusinghtml().
var mySection = merge.context.sections["Section 1"];
var promoTxt = loadhtml('snippets/promo-' + record.fields['City'] + '.html');
mySection.html(promoTxt);
margins
ThemarginsobjectisusedtosetaPrintsectionorMasterPage'smarginsinaControlScript(see
"ControlScripts"onpage838and"ControlScriptAPI"onpage1271).
NotethatMasterPagesareonlyusedinaPrintcontext(see"MasterPages"onpage462).
Themarginsobjectisretrievedviathesectionobject(see"section"onpage1305)orviathemas-
terpagesarrayinatemplate(see"masterpage"onpage1274),respectively.
Fields
Field Type Description
bottom
left
right
top
String Thesefieldsallowtosetthebottom,left,rightandtopofaPrintsection,usingaMeasurementstring,for
example:"2in"(thissetsamargintotwoinches).
footer
header
String ThesefieldsallowtosettheheaderandfooterofaMasterPage,usingaMeasurementstring.
Page 1193