2022.2

Table Of Contents
merge.context.sections['Section 4'].enabled = true;
merge.context.sections['Section 4'].restartPageNumber = false;
merge.context.sections['Section 5'].enabled = false;
merge.context.sections['Section 6'].enabled = true;
merge.context.sections['Section 6'].part = "PDFAttach2";
} else if (merge.context.type == ContextType.WEB) {
merge.context.sections['default Section'].enabled = false; // disable
whatever is the default section
merge.context.sections['Section A'].enabled = true;
merge.context.sections['Section A'].part = "WebPartA";
merge.context.sections['Section B'].enabled = true;
merge.context.sections['Section B'].part = "WebPartB";
}
}
Note: Foranotherexample,seethishow-to:Outputsectionsconditionally.
Note: IftheEmailPDFPasswordScriptWizarddefinesapassword,andatemplatehasaCon-
trolScriptthatcreatesmultiplePDFattachments,alltheattachmentsaresecuredbythesame
passwordbydefault.UsingaControlScript,youcansetsetdifferentpasswordsforattachments;
see"ControlScript:SecuringPDFattachments"onpage849.
Positioning the background of a Print section
ThesescriptsbothsetthebackgroundofaPrintsectiontothesamePDF,buttheypositionitdif-
ferently.
Usingabolutepositioning
var activeSection = merge.template.contexts.PRINT.sections['Section 1'];
activeSection.background.source = BackgroundResource.RESOURCE_PDF;
activeSection.background.position = MediaPosition.ABSOLUTE;
activeSection.background.left = "10mm";
activeSection.background.top = "10mm";
activeSection.background.url = "images/somepage.pdf";
ScalingtoMediasize
var activeSection = merge.template.contexts.PRINT.sections['Section 1'];
activeSection.background.source = BackgroundResource.RESOURCE_PDF;
activeSection.background.position = MediaPosition.FIT_TO_MEDIA;
activeSection.background.url = "images/somepage.pdf";
Page 1310