2021.2

Table Of Contents
Example
The following script sets the background for a section called 'Policy' to RESOURCE_PDF and
specifies a path for it, using a data value:
// Enable the section background and specify that the PDF should be
read
// from a resource file rather than using a PDF DataMapper
background
merge.template.contexts.PRINT.sections['Policy'].background.source
= BackgroundResource.RESOURCE_PDF;
// Specify the path
var resourceUrl = 'images/policy-' + record.fields.policy + '.pdf';
merge.template.contexts.PRINT.sections['Policy'].background.url =
resourceUrl;
Note
To learn how to set a PDF file as a background image on a Print section without a
Control Script, see "Using a PDF file or other image as background" on page492.
Channel
Channel is an enumeration for the output channels. The active output channel is registered in
merge.channel.
The channel doesn't change when the output consists of different contexts. When generating
email, for example, the channel is EMAIL, even when merging the Print context to attach it to
the email.
Value Description
EMAIL The merge request is for output to Email.
PRINT The merge request is for output to Print.
WEB The merge request is for output to Web.
Page 1439