header/footer not display pdf - edocengine - rvreportrelper

General TRichView support forum. Please post your questions here
Post Reply
RobertoVG
Posts: 40
Joined: Fri Mar 15, 2013 8:35 pm

header/footer not display pdf - edocengine - rvreportrelper

Post by RobertoVG »

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;
Post Reply