2019.2

Table Of Contents
Field Type Description
images/background.pdf.
l A URL (either file:, http:, or https:). 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.
l An absolute Windows-style path.
A relative path and a URL are expected to be URL
encoded. For example, a space needs to be encoded
as %20.
An absolute Windows-style path does not need to be
URL encoded, but in JavaScript any backslashes in a
String need to be double-escaped:
"C:\\Images\\Image.pdf".
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;
Page 1372