1.4

l Make the page numbering continue over all print sections
l Select one print section as PDF attachment if the output is to be emailed, and another
print section if the output is to be printed
l Output one web page or another, based on the value of a data field
You need some knowledge of JavaScript to edit Control Scripts, just as for any other self-made
scripts, because there is no Control Script Wizard; see "Write your own scripts" on page 376.
This topic explains how to add a Control Script, how to use a Control Script to change the page
numbering in Print output, and how to write a Control Script that splits one generated document
into multiple files or attachments.
For examples and for more uses of Control Scripts, see the sample scripts in the Control Script
API: "Sample scripts" on page 216.
Tip
New Control Scripts added to the template contain a few examples. For more examples see
"Sample scripts" on page 216.
Adding a Control Script
To add a Control Script:
1.
On the Scripts pane at the bottom left, click the black triangle on the New button and click
New Control Script. A new script appears in the list.
2. Double-click the new script to open it. The script editor appears.
3. Change the name of the script so that it reflects what the script does.
4. Write the script; see the "Control Script API" on page 211. If you are not familiar with
scripting, also see "Write your own scripts" on page 376.
Note: a newly added Control Script contains code to continue page numbering over all
print sections, and two examples: one to select different sections of a Print context for an
email and for print output, and one to select a web section.
Page numbering
Page numbering starts with page 1 for each section by default. If for a section
restartPageNumbering is set to false (see "Control Script API" on page 211), that section will
start with the page number following the last page of the previous section.
Page 389