Page 1 of 1

Identify RTF or RVF

Posted: Fri Oct 26, 2018 4:02 am
by pgkammath
Earlier, I used to save RTF data as blob in SQL server 2014, now i have moved to RVF format for better control.
On loading, is there a way to know, whether the data saved is RVF or RTF, so that we can set the viewer accordingly.

I use the following procedure to load the data into TRichviewEdit.

Certlist is the Table, 'current_advice' is the blob field

procedure TEditor.LoadReportData;
var Stream: TMemoryStream;
begin
try
Stream := TMemoryStream.Create;
(CertList.FieldByName('Current_advice') as TBlobField).SaveToStream(Stream);
Stream.Position := 0;
TransitData.LoadRVFFromStream(Stream);
TransitData.Format;
finally
Stream.Free;
end;
end;

Thanks in advance

Re: Identify RTF or RVF

Posted: Fri Oct 26, 2018 9:17 am
by Sergey Tkachenko
Change LoadRVFFromStream to LoadFromStream(Stream, rvynaAuto);

LoadFromStream can detect RTF and RVF.

Re: Identify RTF or RVF

Posted: Fri Oct 26, 2018 9:32 am
by pgkammath
Thanks, Sergy for the prompt reply. Problem solved.