4D Write Pro documents can contain images from different sources and in various formats. These images may, in some cases, not be displayed for totally reasonable reasons — such as invalid URLs, formulas returning empty images, formats not supported by the platform, etc.
However, they are always represented by a small empty rectangle showing their theoretical location. If you want to change this behavior, 4D v19 R6 is shipped with a new view option enabling you to make empty images completely invisible.
With and without setting the new property
Visible empty images 🙁
Hidden empty images 🙂
wk VISIBLE empty images
This new property is a view property like the ruler display or the zoom factor. It is never stored in the document. Furthermore, it only applies when the formulas are executed, i.e., when the document is displayed in “values” mode and not in “formulas” mode, the latter remains visible.
Finally, for compatibility reasons, this new property is set to “true” by default, i.e., empty images remain represented by an empty rectangle.
Three ways to proceed
The choice between these display modes can be made in several different ways. Choose whatever suits you best:
Via the property list
The first and most straightforward way is to use the property list, which offers a new entry in the appearance theme. The concerned form object will automatically take this choice into account.
Via the user interface
The second choice is to use the user interface in which a new element appears. Either in the toolbar or in the sidebar.
Finally, this can also be done by programming in one line of code:
WP SET VIEW PROPERTIES(*; "WParea"; New object(wk visible empty images; False))
Once this code is executed, the empty and unsupported images will be effectively hidden.
pdf, Docx, and SVG exports
The wk visible empty images parameter can also be used in a different context for exports. Indeed, why would you not wish to avoid exporting images when they are empty? Well, it is now possible to use this option when exporting!
many ways to do so (again):
This can be determined through the interface dialogs that precede the export…
… or programmatically by adding this new option to the object passed as a parameter
$o:=New object(wk visible empty images; False) WP EXPORT DOCUMENT(WParea; $path; wk pdf; $o)
This new option will make it easy to set how documents should be displayed and/or exported. Either effortlessly via the user interfaces or by programming for even more precision and control.