KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Setting header height in 4D Write Pro
PRODUCT: 4D | VERSION: 19 | PLATFORM: Mac & Win
Published On: May 9, 2022

When trying to customize the header height in 4D Write Pro, typically the first command that comes to mind is WP SET ATTRIBUTES. However, WP SET ATTRIBUTES with the height attribute will not work with a header object. Instead, the paragraph object within the header object is the actual argument that needs to be set as shown below:

C_OBJECT($header_o)
C_OBJECT($paragraph_o)

$header_o:=WP Get header(WPArea; 1) // Get header object

If ($header_o=Null) // If no header, create one
   C_OBJECT($section_o)
   $section_o:=WP Get section(WPArea; 1)
   $header_o:=WP New header ($section_o)
End if

$paragraph_o:=WP Paragraph range($header_o) // Get paragraph range of header
WP SET ATTRIBUTES($paragraph_o; wk min height; "3cm") // Set min height
WP SET TEXT($header_o; "Header text here"; wk append) // Optional header text