TCustomRichView.SetFooter

<< Click to display table of contents >>

TCustomRichView.SetFooter

Assigns the specified document for using as a footer.

procedure SetFooter(Footer: TCustomRVData
  HeaderType: TRVHFType = rvhftNormal);

(introduced in version 17)

Parameters:

Footer – document which will be used as a footer (of the type specified in HFType);

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

This footer will be used when saving and loading files and streams. It will not be used for printing, use TRVPrint.SetFooter for assign footers for printing.

Saving:

Footer will be saved together with the main document in RVF;

Footer will be saved together with the main document in RTF and DocX, if rvrtfSaveHeaderFooter is included in RTFOptions;

Footer will be saved after the main document in HTML, if HTMLSaveProperties.SaveHeaderAndFooter = True.

Loading:

when loading RVF, RTF, DocX containing a footer of this type, it will be read in Footer;

 

Each document assigned as a header/footer must be linked to each own TRVStyle component. Values of UseStyleTemplates must be the same for the main document and all headers and footers. UseStyleTemplates = True, MainRVStyle of RVStyles of headers and footers must be equal to RVStyle of the main document (to allow them using the same collections of StyleTemplates).

 

Example:

RichView1.Clear;

RichView2.Clear;

RichView1.RTFReadProperties.ReadDocParameters := True;

RichView1.SetFooter(RichView2.RVData);

RichView1.LoadRTF('test.rtf');

RichView1.Format// contains document

RichView2.Format// contains header

RVPrint1.AssignSource(RichView1);

if RichView2.ItemCount>0 then

  RVPrint1.SetFooter(RichView2.RVData)

else
  RVPrint1.SetFooter(nil);

RVPrint1.AssignDocParameters(RichView1.DocParameters);

RVPrint1.FormatPages(rvdoAll);

RVPrint1.Print('Doc with footer'1, False);

See also:

SetHeader.

See also properties of TRVStyle:

MainRVStyle.