2020.2

Table Of Contents
Control Script that sets a Print section's background.
Note that the settings made in a Control Script take precedence over the settings made in the
Print Section Properties dialog.
Note
Encrypted PDF files are not supported in PDF pass-through mode.
For information about Control Scripts in general, see "Control Scripts" on page417 and
"Control Script API" on page889. If you don't know how to write scripts, see "Writing your own
scripts" on page381.
Setting a background in script
The Control Script should first enable a background on the section, in case an initial
background wasn't set via the user interface. This is done by setting the source type for the
background of the section to Resource PDF (see "BackgroundResource" on page920). For
example:
merge.template.contexts.PRINT.sections['Policy'].background.source
= BackgroundResource.RESOURCE_PDF;
For a Resource PDF, the Control Script should specify a path, for example:
var resourceUrl = 'images/policy-' + record.fields.policy + '.pdf';
merge.template.contexts.PRINT.sections['Policy'].background.url =
resourceUrl;
Note
An image with an unknown file extension is represented by a red cross in the output, but
no error is logged unless the image refers to a local file that does not exist on disk.
Image file extensions that the software recognizes are: AFP, BMP, EPS, GIF, JPG/JPEG,
PCL, PDF, PNG, PS, SVG, and TIF/TIFF.
Page 426