4D Write Pro documents: a useful new parameter

Automatically translated from English

4D Write Pro has been designed to create all kinds of documents, from the most simple to the most sophisticated. To achieve this diversity, documents can hold distinct parts, like paragraphs, sections, headers, footers, etc. Once filled in, 4D Write Pro behaves in such a way that all of these parts can be read. However, sometimes some parts must be resized according to their content. This is typically the case for headers and footers whose height can change automatically. This functionality is generally very useful, but sometimes it’d be more practical to set the heights of headers and footers to constant values (even if their content may be truncated and no longer be fully visible).

DWP: new autofit parameter

A new document parameter

The purpose of this document parameter is to determine whether headers and footers should be automatically resized based on their content or not. Just remember that the content of headers and footers can either be written by users or generated using 4D expressions that can return huge texts or images.

In most cases, the “auto fit” behavior is really useful. But what if the documents are generated using templates or some important constraints must be respected so that the generated documents correspond to the required paper format? In this case, it may sometimes be preferable to have truncated information in the header or footer, rather than in the main part of the document.

Compatibility with 4D Write documents

In the case of newly created documents, this parameter is set to “on” (i.e., auto-resize headers and footers will be activated), but in the case of imported 4D Write documents, then it will be “off” in order to maintain their 4D Write behavior.

Code sample

Turning this parameter “on” or “off” is really simple:

WP SET ATTRIBUTES(WParea;wk header and footer autofit;True)
// or
WP SET ATTRIBUTES(WParea;wk header and footer autofit;False)


Roland Lannuzel

• Product Owner & 4D Expert •

After studying electronics, Roland went into industrial IT as a developer and consultant, building solutions for customers with a variety of databases and technologies. In the late 80’s he fell in love with 4D and has used it in writing business applications that include accounting, billing and email systems.

Eventually joining the company in 1997, Roland’s valuable contributions include designing specifications, testing tools, demos as well as training and speaking to the 4D community at many conferences. He continues to actively shape the future of 4D by defining new features and database development tools.