Tips & Tricks for your 4D Apps – July Edition

by Add Komoncharoensiri, Director of Technical Services at 4D Inc


Here we go with another set of tips and tricks.

As you know, 4D Knowledge Base is a library of information about the 4D technology where weekly tech tips and monthly technotes are actively published. If you missed the last tips on the KB, that’s fine; here is a compilation from the past few weeks.

This blog post covers 16 tips:

Product blank

4D Write Pro: Disable Visibility of Empty Images

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.

Product blank

Great news! The image settings dialog is here

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


Product blank

4D Write Pro – New image formats

Starting with 4D v19 R2, inline as well as anchored images inside 4D Write Pro documents will benefit from new formatting types.

We’ve also made it much easier to format the images used as background of documents, sections, paragraphs, etc.

Let’s find out more about these enhancements.

Product blank

SVG “non-scaling-stroke” attribute support

Sometimes it’s preferable to have the lines of an object keep their original width, regardless of the applied transformation. For example, you draw a line on a map showing a user’s position and a destination. When the user zooms in on the map, you want to enlarge the map but have the line maintain its width.

Tips blank

Breathe life into your 4D Write Pro documents with pictures

Unless you’re Stephen King and planning to write the next best seller, you may want to avoid long block of texts. And you can do this by using illustrations and images in your documents! Luckily, working with pictures in 4D Write Pro is evolving with every release, and these graphic-related features allow you to breathe life into your drab black and white text documents. In this blog post, we’ll explain the different types of pictures in 4D Write Pro, their use, and how to take advantage of them to create visually compelling documents!

Product blank

Images in absolute position in 4D Write Pro

Pictures speak louder than words, or so they say. In fact, according to researchers the brain processes images 60,000 times faster than words. 4D Write Pro is constantly evolving, version after version, to support more and more picture-related features. After in-line pictures and background pictures, 4D v16 R6 gives you the full control over picture insertion at a specific position in a document, in front of or behind text, as well as anchored to the page or specific parts of the document (i.e., header, footer, sections).

Product blank

4D Write Pro now supports picture expressions

This blog post explores a 4D Write Pro-related functionality which will help you with the creation of complex documents, programmatically. Documents that can be either printed or sent by email.

An expression can now be a Picture! Handling pictures in your 4D Write Pro documents is becoming easier, offering vast possibilities. From now on, any expression returning a picture can be inserted. The most obvious cases are fields and variables, but it goes also for 4D functions and, last but not least, your own methods!