1.8

Table Of Contents
var pdf = resource("images/stamp.pdf", 2);
var height = pdf.height;
var width = pdf.width;
var numberOfPages = pdf.pages;
In this script, the function is used to check if a file exists.
if(resource("C:/paw.pdf")){
//exists
} else {
//oops
}
Control Script API
The table below lists the objects that are the most important in Control Scripts. Click through to
the object to find a description and sample scripts.
See "Control Scripts" on page281 for information about this kind of scripts, how to insert them
and what you can do with them.
Object Usage
"section"
on
page564
Much of the Control Script magic is performed by setting one of the fields of
the section object. Via the section object you can omit, select and clone
sections; add a background to a Print section; add a header to an email; etc.
A section can be retrieved via the context that it belongs to, using
merge.template.contexts.ContextType.sections["section name"]. For
example: merge.template.contexts.PRINT.sections["Section EN"].
"context"
on the
facing
page
Object that contains one context and its sections. It is accessed through the
template object: merge.template.contexts.
To get access to one context, you have to specify the ContextType (see
"ContextType" on page577), for example: var printContext =
merge.template.contexts.PRINT;.
Through the merge object you can find out which context is currently being
merged: merge.context.
"template"
on
page573
The template object contains all contexts and sections. It is accessed
through the merge object: merge.template.
Page 559