2019.1

Table Of Contents
Field Type Description
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;
Tip
For more examples, see "Control Script: Setting a Print section's background" on
page836.
clone()
This function returns a new set containing a copy of each element in a set; see "Dynamically
adding sections (cloning)" on page839.
To duplicate an existing template element, clone it before calling append(); see "Examples" on
page1232.
Page 1297