2021.1

Table Of Contents
var printSections;
if (channel == Channel.EMAIL) { // only when generating Email
output
if (merge.context.type == ContextType.PRINT) {
printSections = merge.template.contexts.PRINT.sections;
printSections['Section 1'].part = 'PDFAttach1';
printSections['Section 2'].part = 'PDFAttach2'
printSections['Section 2'].password = 'secret';
}
}
Post Pagination Scripts
Post Pagination Scripts are run in a Print context after the content has been paginated.
Because they can search through the output of all Print sections, and modify Print sections (one
at a time), they may be used to create a Table Of Contents (TOC), as explained in the topic:
"Creating a Table Of Contents" on page921.
This topic explains what a Post Pagination Script is and how to add it to a template.
The basics of script-writing in the Designer are explained in the following topic: "Writing your
own scripts" on page867.
What Post Pagination Scripts are
Post Pagination Scripts are a special kind of Designer script: they are applied to the output of
all sections in a Print context after the content has been paginated.
Post Pagination Scripts differ from Standard Scripts and Control Scripts in two ways:
l Post Pagination Scripts run after all other scripts, more precisely: after the content has
been paginated. The pagination process applies page breaks to the content of a Print
section, adds Master Pages and sets the Media. A Post Pagination Script may query the
rendered document and collect information about elements (for instance, on which page
they reside on) and sections (for instance, whether they are enabled). If needed, a Post
Pagination Script can change the sheet configuration and re-paginate a section.
l Post Pagination Scripts only apply to the Print context. The output of other contexts is not
paginated.
Page 919