Need help in Loading HTML using RVHtmlImporter

General TRichView support forum. Please post your questions here
Post Reply
Aeperd
Posts: 18
Joined: Thu Dec 26, 2024 1:30 pm

Need help in Loading HTML using RVHtmlImporter

Post by Aeperd »

What did i miss here?

RichViewEdit1.Clear;
RvHtmlImporter1.LoadHtml(memo1.Text);
RichViewEdit1.Format;

Im trying to load an HTML from a string or memo1 to RichViewEdit1 but it doesnt display the correct formatting.
Sergey Tkachenko
Site Admin
Posts: 17749
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Need help in Loading HTML using RVHtmlImporter

Post by Sergey Tkachenko »

RvHtmlImporter1 is an obsolete component; it supports only basic HTML formatting.
Use this code:

Code: Select all

var
  Stream: TStringStream.

RichViewEdit1.Clear;
Stream:=TStringStream.Create(memo1.Text, TEncoding.UTF8);
RichViewEdit1.LoadHTMLFromStream(Stream, '', CP_UTF8);
RichViewEdit1.Format;
Stream.Free;
Aeperd
Posts: 18
Joined: Thu Dec 26, 2024 1:30 pm

Re: Need help in Loading HTML using RVHtmlImporter

Post by Aeperd »

Thank you so much sir! Perfect!
Post Reply