Header & Footer
|[Top] [Chapter] [Previous] [Next]|
Here we talk about the header and footer areas which may be printed on certain or all pages.
They are implemented as layers which means in general they need to be activated to be editable.
Here You see a header text in edit mode.
Internally headers and footers are implemented as "RTF Data Block" objects, just like the body of the document.
You can also use this API to create header and footers:
To leave the header or footer use IWPTextCursor.GotoBody.
Normally the user can switch any header or footer element into edit mode by double clicking on it. This can also be switched off, using Memo.SetBProp(2,3,1), also see wpEditOptionsEx. While editing the body, the user sees the header and footer in shades of gray. This mode can be disabled using Memo.SetBProp(6, 19, 1), also see wpViewOptions.
You can now insert page numbering:
TextCursor = WpdllInt1.Memo.TextCursor;
TextCursor.InputFieldObject("PAGE", "", "1");
TextCursor.InputFieldObject("NUMPAGES", "", "9");
There is also a dialog to create, locate and delete header and footer elements.
It is displayed by the wpaDiaManageHeaderFooter Action. You can show it with wpaProcess("DiaManageHeaderFooter", "").
A header text may also contain images. If this images are managed relatively to the page they can also be moved down the body of the document. This feature can be used to create watermarks. (BTW: The integrated PDF engine will make sure, the image is not embedded only once.)