Skip to main content
Version: Next

WP Get footer

WP Get footer ( targetObj ) | (wpDoc ; sectionIndex {; sectionSubType} ) : Object

ParameterTypeDescription
targetObjObject4D Write Pro range or section/sub-section element
wpDocObject4D Write Pro document
sectionIndexIntegerSection index
sectionSubTypeIntegerType of subsection (wk first page, wk left page, or wk right page)
Function resultObject4D Write Pro footer

Description

The WP Get footer command returns the footer associated to the targetObj range or to the specified sectionIndex of the wpDoc document. If no footer is found with regards to the parameter(s), the command returns Null.

  • With the first syntax (using the targetObj parameter), the command returns the footer of the first page in the range or the section/sub-section passed in parameter. If a sub-section is active on the page, the command returns the footer of the active sub-section, so it always returns the visible footer.
  • With the second syntax (using the wpDoc parameter), the command returns the footer of the specified sectionIndex section (sectionIndex value must be >=1).
    If the subSectionType parameter is passed, the command returns the footer associated to the specified sub-section type. You can pass one of the following constants in the subSectionType parameter:
ConstantTypeValue
wk first pageInteger1
wk left pageInteger2
wk right pageInteger3

If the subSectionType is not specified, the main section footer will be returned. In this case, if a sub-section is active, the main section footer object is undefined (the main section footer is available only if there is no active wk first page or wk left page sub-section).

Example

You want to copy the footer of the first page of a 4D Write Pro document to the footer of all pages of another 4D Write Pro document:

 var $footerSource;$rangeSource;$tempoc;$footerTarget;$rangeTarget : Object
 
 $footerSource:=WP Get footer([TEMPLATES]WPtemplate;1;wk first page) //get the first page footer of section 1
 $rangeSource:=WP Text range($footerSource;wk start text;wk end text)
 $tempoc:=WP New($rangeSource)
 
 $footerTarget:=WP Get footer([Docs]MyWPDoc;1) //all pages of section 1
 $rangeTarget:=WP Text range($footerTarget;wk start text;wk end text)
 
 WP INSERT DOCUMENT($rangeTarget;$tempoc;wk replace)

See also

Using a 4D Write Pro area
WP DELETE FOOTER
WP Get frame
WP Get header
WP New footer