2022.2

Table Of Contents
scriptsetsboththeuserandownerpasswordtothesamevalue,sothatwhentherecipientprovides
thepassword,hecanmanipulatethefilewithoutlimitations.
InaControlScript:
l
passwordisusedtosettheuserpasswordandownerpasswordforaPDFattachmenttothe
samevalue.
l
ownerPasswordisusedtosettheownerpasswordforaPDFattachment.Settingonlythe
ownerpasswordcreatesasecuredPDFthatcanbefreelyviewed,butcannotbemanipulated
unlesstheownerpasswordisprovided.NotethattherecipientneedsAdobeAcrobattodothis,
becausetheAcrobatReaderdoesnotallowuserstoentertheownerpassword.
Removingapassword
PasswordssetintheControlScriptoverridethepasswordsetthroughtheEmailPDFpasswordscript
(see"EmailPDFpassword"onpage488).Thisallowsyoutochangeorremovethepasswordfroma
specificpart.Removalisdonebysettingthepasswordfieldtonulloranemptystring("").
ThisscriptsplitsthePrintoutputintotwoPDFattachmentsandsetsapasswordforthesecondattach-
ment.
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
PostPaginationScriptsareruninaPrintcontextafterthecontenthasbeenpaginated.Becausethey
cansearchthroughtheoutputofallPrintsections,andmodifyPrintsections(oneatatime),theymay
beusedtocreateaTableOfContents(TOC),asexplainedinthetopic:"CreatingaTableOfContents"
onpage852.
ThistopicexplainswhataPostPaginationScriptisandhowtoaddittoatemplate.
Thebasicsofscript-writingintheDesignerareexplainedinthefollowingtopic:"Writingyourown
scripts"onpage808.
WhatPostPaginationScriptsare
PostPaginationScriptsareaspecialkindofDesignerscript:theyareappliedtotheoutputofallsec-
tionsinaPrintcontextafterthecontenthasbeenpaginated.
PostPaginationScriptsdifferfromStandardScriptsandControlScriptsintwoways:
Page 850