|
Control Script: Setting a Print section's backgroundIn the Print context, a PDF file can be used as a Print section's background. To learn how to do this without a Control Script, see Using a PDF file as background image. For information about Control Scripts in general, see Control Scripts and Control Script API. If you don't know how to write scripts, see Writing your own scripts. Setting a background in scriptThe Control Script should first enable a background on the section, in case an initial background wasn't set via the user interface. This is done by setting the source type for the background of the section to
Positioning the backgroundAfter that, the background can be positioned, setting the section's
For all possible positions, see MediaPosition. Setting a page range in scriptWhen a PDF that serves as a dynamic section background has multiple pages, you can specify a range of pages to be used, in a control script. The following script sets the page range from 2 to 5:
You could use the
resource() function to check the number of pages or for example the page height and width before setting it as a background (see resource()).ExampleThis scripts sets a background on a Print section using absolute positioning.
You could replace the last three lines of the previous script by the following line to scale the Print section background to Media size:
|
|