2019.2

Table Of Contents
resources as its background. It explicitly enables the clone and then adds it to the Print context.
var printSections = merge.template.contexts.PRINT.sections;
merge.template.contexts.PRINT.sections["Policy"].enabled = false;
if(record.fields.policy_a == 1) {
addPolicy('a');
}
if(record.fields.policy_b == 1) {
addPolicy('b');
}
function addPolicy(policy){
var resourceUrl = 'images/policy-' + policy + '.pdf';
var clone = printSections["Policy"].clone();
clone.name = "policy_" + policy;
clone.background.url = resourceUrl;
clone.enabled = true;
printSections["Policy"].addAfter(clone);
}
background
The background object holds the PDF background of a Print section (see "section" on
page1395 and "Control Script: Setting a Print section's background" on page893).
Note
Setting a page range using the start and end fields automatically sets
background.allPages to false.
When you first define a page range and then set background.allPages to true, the page
range will be disabled.
Fields
Field Type Description
allPage
s
Boolean Show all pages from the PDF.
end Number The end page of the PDF to use as a background for
the section.
Page 1370