2022.1

Table Of Contents
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 another example, see this how-to: Output sections conditionally.
Control Script: Setting a Print section's background
In the Print context, an image file can be used as a Print section's background; see "Using a
PDF file or other image as background" on page523.
If you want the section background to be switched automatically, depending on the value of a
data field, you need a Control Script. There is a Script Wizard that can generate that script for
you, provided that certain conditions are met; see: "Dynamic Print section backgrounds" on
page885.
Otherwise, you will have to write the Control Script yourself. This topic explains how to write a
Control Script that sets a Print section's background.
Note that the settings made in a Control Script take precedence over the settings made in the
Print Section Properties dialog.
Note
Encrypted PDF files are not supported in PDF pass-through mode.
For information about Control Scripts in general, see "Control Scripts" on page954 and
"Control Script API" on page1466. If you don't know how to write scripts, see "Writing your own
scripts" on page918.
Page 963