2018.1

Table Of Contents
Field Type Description
top
Measurement
The top offset of the PDF background (only when
absolute positioning is selected).
url String The location of the PDF to use as a background for
the section. For a file named background.pdf, stored
inside the template resources, the url would be
images/background.pdf.
The complete syntax for an external file
is:file://<host>/<path>. If the host is"localhost", it
can be omitted, resulting infile:///<path>, for
example:
file:///c:/resources/images/image.jpg
.
Example
This scripts sets a background on a Print section using absolute positioning.
var activeSection = merge.template.contexts.PRINT.sections['Section
1'];
activeSection.background.source = BackgroundResource.RESOURCE_PDF;
activeSection.background.url = "images/somepage.pdf";
activeSection.background.position = MediaPosition.ABSOLUTE;
activeSection.background.left = "10mm";
activeSection.background.top = "10mm";
You could replace the last three lines of the previous script by the following line to scale the
Print section background to Media size:
activeSection.background.position = MediaPosition.FIT_TO_MEDIA;
Tip
For more examples, see "Control Script: Setting a Print section's background" on page353.
Page 697