I am trying to export to PDF but only the body of the text appears, but without the header and footer. What is wrong?
procedure TFormEditor.btPdfClick(Sender: TObject);
var Stream: TMemoryStream;
begin
Stream := TMemoryStream.Create;
ActiveEditor.RichViewEdit.SaveRVFToStream(Stream,false);
Stream.Position := 0;
RVReportHelper1.RichView.Style := TRVStyle.Create(RVReportHelper1);
RVReportHelper1.RichView.Options := RVReportHelper1.RichView.Options+[rvoTagsArePChars];
RVReportHelper1.RichView.RVFOptions := RVReportHelper1.RichView.RVFOptions+[rvfoLoadDocProperties];
RVReportHelper1.RichView.RTFOptions := RVReportHelper1.RichView.RTFOptions+[rvrtfSaveDocParameters]+[rvrtfSaveHeaderFooter];
RVReportHelper1.RichView.RTFReadProperties.SetHeader(ActiveEditor.RichViewEdit.RVData);
RVReportHelper1.RichView.RTFReadProperties.SetFooter(ActiveEditor.RichViewEdit.RVData);
RVReportHelper1.RichView.LoadRVFFromStream(Stream);
// Set output PDF file name
gtPDFEngine1.FileName := 'c:\teste\teste.pdf';
// Render RTF document as PDF
gtRichViewInterface1.RenderDocument(RVReportHelper1);
// Free memory
RVReportHelper1.Clear;
Stream.Free;
end;