Page layout in 4D Write Pro

When creating a document, you need to define the page size, orientation, and margins. Starting with v17 R3, you can do all this by programming. And for that, new attributes are at your disposal.

You can set the properties for an entire 4D Write Pro document. These values are used by default for all sections of the document. You can then change them for a given section.

As you may have guessed, these changes are made with the WP SET ATTRIBUTES command. You can also retrieve values with WP GET ATTRIBUTES.

The new attributes are:

  • wk page width, wk page height – for page size
  • wk page orientation – for page orientation
  • wk page margin, wk page margin left, wk page margin right, wk page margin top, wk page margin bottom – for page margins


For example, this document is in landscape orientation, except the second section:

WP SET ATTRIBUTES(wpDoc; wk page orientation; wk landscape)
$section:=WP Get section(wpDoc;2)
WP SET ATTRIBUTES($section; wk page orientation; wk portrait)

As another example, to retrieve the size of the page:

WP GET ATTRIBUTES(wpDoc; wk page width; $width; wk page height; $height)


Vanessa Talbot
• Product Owner •Vanessa Talbot joined 4D Program team in June, 2014. As a Product Owner, she is in charge of writing the user stories then translating it to functional specifications. Her role is also to make sure that the feature implementation delivered is meeting the customer need.Since her arrival, she has worked to define key features in 4D. She has worked on most of preemptive multi-threading new features and also on a very complex subject: the new architecture for engined application. Vanessa has a degree from Telecom Saint-Etienne. She began her career at the Criminal Research Institute as a developer for the audiovisual department. She has also worked in media and medical fields as expert in technical support, production as well as documenting new features.