There are common user stories where there is a need to have a background image fill the entire printable area, such as paper-folding lines or a watermark. It’s also sometimes required by a company’s graphic charter.
Thanks to a newly added style for background images, it is now possible to create background pictures filling the full page in 4D Write Pro! You can control this attribute, by either the 4D language or standard actions, or even by using the 4D Write Pro widget.
For a better understanding, this feature can be summarized with the illustration below:
Many options are available for background pictures, including clipping, repeating pattern and origin. Images could already be clipped to the border, the padding or to the content in previous versions. But they could not be clipped to the “paper”. Now they can!
The new attribute value (wk paper box) is available for documents/sections for background clipping and background origin.
Of course, the 4D Write Pro widget has also been updated: when selecting the “background picture” and “document” items, the clip and origin options now have a new paper-box option available.
Programming options
You can use the WP SET ATTRIBUTES command and set the new wk paper box value for background picture clipping and origin.
WP SET ATTRIBUTES(wpDoc;wk background image;vPict)
WP SET ATTRIBUTES(wpDoc;wk background clip;wk paper box)
WP SET ATTRIBUTES(wpDoc;wk background origin;wk paper box)
Another option is to use the standard actions with the INVOKE ACTION command, or in design mode as any other standard action.
// Set origin and clipping for document background image
INVOKE ACTION("doc/backgroundClip?value=paper-box")
INVOKE ACTION("doc/backgroundOrigin?value=paper-box")