2022.2

Table Of Contents
Field Type Description
channel
"Channel"on
page1294
Thefinaloutputchannel:EMAIL,PRINTorWEB.Thechanneldoesn'tchangewhentheoutputconsistsofdif-
ferentcontexts.Whengeneratinganemail,forexample,thechannelisEMAIL,evenwhenmergingthePrint
contexttoattachittotheemail.
"context"on
page1299
Context Thecontextrenderedbythismergerun.Ifforonerecord,differentcontextsneedtobeoutput(forexample,
whenthePrintcontextisattachedtoanemail)arecordismergedmultipletimes:oncepercontext.Per
mergerun,merge.contextshowswithwhichcontexttherecordismerged.
pagination
"Pagination"on
page1314
ContainsthetotalpagecountandsheetcountofallsectionsinthePrintcontextafterpagination.
"section"on
page1305
Section InStandardScripts,thisobjectdefinesthesectionthatisbeingmerged.
Note!InControlScripts,merge.sectionisonlyavailablewhentheoutputchannelisWEB.Tomake
surethatitisdefined,usethefollowingstatement:if (merge.channel == Channel.WEB &&
merge.context.type == ContextType.WEB) { ... }.
ToretrieveanysectioninaControlScript,use:merge.tem-
plate.contexts.ContextType.Section['Section name'];(forexample:merge.tem-
plate.contexts.PRINT.sections["Section EN"]).
InPostPaginationScripts,onlyPrintsectionsareavailable.
"template"on
page1292
Template Thisobjectcontainsthetemplateandallofitscontexts.Itcanbeusedtofindoutwhichcontextsareavailable
inthetemplate,usingmerge.template.contexts(see"context"onpage1299)andtomanipulatethe
sectionsinthosecontexts(see"section"onpage1305).
resource()
Theresource()functionreturnsinformationaboutanimageresource.Thisfunctionisusefulina
ControlScript,forexampletocheckthenumberofpagesorthepageheightandwidthbeforesettingit
asabackground(see"ControlScript:SettingaPrintsection'sbackground"onpage845).
Thisfunctioncanalsobeusedtocheckifafileexists.Itreturnsnullifthefiledoesnotexist.Thereis
noneedtoexplicitlycheckfornull;achecktoseeifaresourceexistscansimplybewrittenas:
var info = resource(path);
if (!info) {
// File does not exist
}
resource(location, pageNumber)
location
ThelocationshouldbeaURLrelativetothetemplaterootoranabsolutefile-basedURL(withoutpro-
tocol),e.g."C:/myfile.pdf".
pageNumber(optional)
Page 1278