<< Click to display table of contents >> TCustomRichView.SetHeader |
Assigns the specified document for using as a header.
procedure SetHeader(Header: TCustomRVData;
HeaderType: TRVHFType = rvhftNormal);
(introduced in version 17)
Parameters:
Header – document which will be used as a header (of the type specified in HFType);
HFType – header type (normal/for the first page/for even pages).
This header will be used when saving and loading files and streams. It will not be used for printing, use TRVPrint.SetHeader for assign headers for printing.
Saving:
▪Header will be saved together with the main document in RVF;
▪Header will be saved together with the main document in RTF and DocX, if rvrtfSaveHeaderFooter is included in RTFOptions;
▪Header will be saved before the main document in HTML, if HTMLSaveProperties.SaveHeaderAndFooter = True.
Loading:
▪when loading RVF, DocX or RTF containing a header of this type, it will be read in Header;
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.SetHeader(RichView2.RVData);
RichView1.LoadRTF('test.rtf');
RichView1.Format; // contains document
RichView2.Format; // contains header
RVPrint1.AssignSource(RichView1);
if RichView2.ItemCount>0 then
RVPrint1.SetHeader(RichView2.RVData)
else
RVPrint1.SetHeader(nil);
RVPrint1.AssignDocParameters(RichView1.DocParameters);
RVPrint1.FormatPages(rvdoAll);
RVPrint1.Print('Doc with header', 1, False);
See also:
See also properties of TRVStyle: