Load HTML from String

General TRichView support forum. Please post your questions here
Post Reply
Testomatico
Posts: 15
Joined: Sat Mar 22, 2014 7:47 pm

Load HTML from String

Post by Testomatico »

Hello,
could someone tell me how to fill the RichViewEdit with a string containing html-code?

Thank you!

Best regards
Testo
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You need to use additional components: TrvHtmlImporter or (better) TrvHtmlViewImporter.

With TrvHtmlImporter, call

Code: Select all

RvHtmlImporter1.LoadHtml(s);
With TrvHtmViewlImporter, call

Code: Select all

HTMLViewer1.LoadFromString(s);
RVHTMLViewImporter1.ImportHtmlViewer(HTMLViewer1, RichViewEdit1);
In the both cases, it is recommended to call NormalizeRichView after loading (RVNormalize.pas from RichViewActions), then call Format.
Post Reply