2022.2

Table Of Contents
l
merge.template.contexts.PRINT.sections['Section 2'].password =
'secret';
l
merge.template.contexts.PRINT.sections['Section 2'].ownerPassword =
'secret';
Whenproducingasingleattachment,thepassword(s)shouldbesetonthefirstPrintsection.
Whenproducingmultipleattachments,itshouldbesetonthefirstsectionofeachpart.
Password types
PDFallowsfortwotypesofpasswordstobesetonasecuredPDFfile:auserpasswordandowner
password.Theuserpasswordallowsalimitedaccesstothefile(e.g.printingorcopyingtextfromthe
PDFisnotallowed).Theownerpasswordallowsnormalaccesstothefile.TheEmailPDFpassword
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"onpage166).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
Page 409