Identify RTF or RVF

General TRichView support forum. Please post your questions here
Post Reply
pgkammath
Posts: 36
Joined: Fri Nov 24, 2017 6:16 am

Identify RTF or RVF

Post 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
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Identify RTF or RVF

Post by Sergey Tkachenko »

Change LoadRVFFromStream to LoadFromStream(Stream, rvynaAuto);

LoadFromStream can detect RTF and RVF.
pgkammath
Posts: 36
Joined: Fri Nov 24, 2017 6:16 am

Re: Identify RTF or RVF

Post by pgkammath »

Thanks, Sergy for the prompt reply. Problem solved.
Post Reply