2022.1

Table Of Contents
Functions and fields
Field Type Description
modified Number Timestamp of the last modification of the image resource, for
example: 1566660504000.
name String The base name of the image resource, for example: "cat.jpg".
path String The path of the image resource, relative to the template, for
example: "images/cat.jpg".
Example
The following script adds an image called 'dog.jpg' to the content of the template if the image
can be found in the template's resources:
const image = merge.template.images.find(image => image.name == 'dog.jpg');
if (image) {
results.after(`<img src=${image.path}>`);
}
MediaPosition
In a Control Script, the position is an enumeration for the position of background resources for
a Print section. It is retrieved and set via background.position.
Field Description
ABSOLUTE Places the PDF at a specific location on the page. Set the background's
top (background.top) and left (background.left) measured from
the top and left side of the section.
CENTERED Centers the PDF on the page, vertically and horizontally.
FIT_TO_
MEDIA
Stretches the PDF to fit the page size.
Page 952