TRVPrint.SetHeader

<< Click to display table of contents >>

TRVPrint.SetHeader

Assigns a page header.

procedure SetHeader(RVData: TCustomRVData;

  FooterType: TRVHFType=rvhftNormal);

(introduced in version 1.7; modified in version 15)

Parameters:

RVData – document to display as a header of the type specified in HFType; the document is not copied to RVPrint, so do not modify and do not destroy it until printing is completed. If RVData is nil, a header of this type is not displayed.

HFType – header type (normal/for the first page/for even pages).

This method must be called before FormatPages.

Using different headers

A header for the first page is used only if TitlePage=True, otherwise it is ignored, and a normal header is displayed on the first page.

A special header for even pages is used only if FacingPages=True, otherwise it is ignored, and a normal header is used on both odd and even pages.

Example:

var

  rvMain, rvHeader: TRichView;

  RVPrint1: TRVPrint;

...

RVPrint1.AssignSource(rvMain);

RVPrint1.SetHeader(rvHeader.RVData);

RVPrint1.TitlePage := True;

// hiding header on the first page

RVPrint1.SetHeader(nil, rvhftFirstPage);

See also:

SetFooter;

AssignSource.

See also properties:

HeaderY.

See also:

TRichView.SetHeader.