1.4

Example 1: no parts defined
Assume there are three Print sections: sections A, B and C. When generating Email output with
the Print context as attachment, all three Print sections will be put together in one file and
attached to the email.
Example 2: 2 parts
Assume there are three Print sections: sections A, B and C. In a Control Script a part name is
defined for section C:
var section = merge.template.contexts.PRINT.sections['Section C'];
section.part = 'Part2';
When generating Email output with the Print context as attachment, the email will have two
attachments:
l attachment 1: Section A, Section B
l attachment 2: "part2", which is Section C. The file name of this attachment is the part
name.
Note
For Web sections, a part always consists of only the given section. Web pages cannot be appended
to form a single part. It is however possible to attach multiple Web pages to one email; see "Sample
scripts" on page 66 for an example.
Print section background
In the Print context, a PDF file can be used as a section's background (see "Using a PDF file as
background image" on page 179).
In a Control Script, you can do the same, and more: you could for example specify a particular
PDF file as a section's background, depending on the value of a field in the current record.
The Control Script should first In case enable a background, in case an initial background
wasn't set via the user interface. Enabling a background is done by setting the source type for
the background of the section to either a DataMapper PDF or an arbitrary PDF. For an arbitry
PDF, the Control Script should specify a path.
Page 211