Images are an essential part of documents. On an invoice for example, getting the right positioning for the company logo is important. That’s why the 4D Write Pro interface component offers a property dialog for images. You or your end users can easily define:
- the size of the image
- the display format
- the margins and padding
- the position on the page for anchored images
quickly Resize, Position, and Format a picture
Thanks to the new Picture settings dialog, you can modify the properties of pictures in a 4D Write Pro document at any time. These properties are related to the position, dimensions, and display mode of the picture. The available properties depend on the inserted picture (in the text flow or on the page). This dialog is available for both the sidebar and toolbar widgets.
Here is how it looks for an image anchored in the page:
If you want to display this dialog from your contextual menu or from an event like “on double click” on the form, just use the “WP PictureSettings” component method.
$range:=WP Selection range(*; "WParea")
WP PictureSettings($range)
easily Insert all types of images
While working on the image properties, we noticed that you could not add an image from a URL with the toolbar widget. This oversight is fixed with 4D v19 R3.
To simplify and combine the three different images types, the button for inserting an image from the disk now displays a menu for inserting an image from the disk, with a URL or formula.
Don’t forget, the source code is available on GitHub. Feel free to adapt it to your needs!