2022.1

Table Of Contents
In a Control Script:
l password is used to set the user password and owner password for a PDF attachment to
the same value.
l ownerPassword is used to set the owner password for a PDF attachment. Setting only the
owner password creates a secured PDF that can be freely viewed, but cannot be
manipulated unless the owner password is provided. Note that the recipient needs Adobe
Acrobat to do this, because the Acrobat Reader does not allow users to enter the owner
password.
Removing a password
Passwords set in the Control Script override the password set through the Email PDF
password script (see "Email PDF password" on page568). This allows you to change or
remove the password from a specific part. Removal is done by setting the password field to null
or an empty string ("").
Example
This scripts splits the Print output into two PDF attachments and sets a password for the
second attachment.
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972.
This topic explains what a Post Pagination Script is and how to add it to a template.
Page 970