When creating a 4D Write Pro document, you need to define the page size, orientation, and margins. Starting with v17 R3, you can do all this by programming. And for that, new attributes are at your disposal.
You can set the properties for an entire 4D Write Pro document. These values are used by default for all sections of the document. You can then change them for a given section.
As you may have guessed, these changes are made with the WP SET ATTRIBUTES command. You can also retrieve values with WP GET ATTRIBUTES.
The new attributes are:
- wk page width, wk page height – for page size
- wk page orientation – for page orientation
- wk page margin, wk page margin left, wk page margin right, wk page margin top, wk page margin bottom – for page margins
Examples
For example, this document is in landscape orientation, except the second section:
WP SET ATTRIBUTES(wpDoc; wk page orientation; wk landscape)
$section:=WP Get section(wpDoc;2)
WP SET ATTRIBUTES($section; wk page orientation; wk portrait)
As another example, to retrieve the size of the page:
WP GET ATTRIBUTES(wpDoc; wk page width; $width; wk page height; $height)