The WP SET ATTRIBUTES command in 4D Write Pro is undoubtedly one of the most frequently used commands, as its vast possibilities apply to all sorts of elements in your documents.
A new document attribute is now available in 4D 20 R5: wk page size. Let’s take a closer look at what it can do!
Document width and height
It is already possible to define the page size of your documents using the wk page width and wk page height attributes. The new wk page size attribute will set two values at once: the width and height of your document.
Another way to do this is to use the interface and directly choose the sizes suggested by the current printer. This option has also been improved!
Available formats, custom and ISO formats
Let’s start with the formats proposed automatically by the interface. Until now, the displayed list depended only on the capabilities of the current (selected) printer ①. From now on, this list will be complemented by custom formats, if any have been created by the user ②, and finally, the most common ISO formats, even if these are not available on your printer ③.
An attribute worth two
Regarding programming, it was already possible to define the width and height of pages. Thanks to this new parameter, this can be done in a single operation. The current printer format names (including custom ones) and all ISO formats can be used, from A0 to A10, B0 to B10, and C0 to C10, including DL, Legal, Legal Junior, and Tabloid.
Again, for ISO values, the format does not need to be available on the current printer; the page sizes of your documents will be defined based on the ISO values regardless of how they will be printed or exported.
WP SET ATTRIBUTES ($document;wk page size;"LegalUS") // ISO format (no space between Legal and US !)
WP SET ATTRIBUTES ($document;wk page size;"Post card") // Printer format
Conclusion
Three features in one! Less code (one attribute instead of two), direct access to custom formats, and more freedom with ISO formats. Feel free to define any document formats for print or export! Let us know how you feel about this great tiny feature on the forum!