Page 1 of 1

Is CSS supported with TRichView

Posted: Fri Apr 11, 2014 2:53 am
by techmon
Greetings!

We sent a test email from gmail with richtext formatting (colored text and different size fonts) to our mail client Delphi application which has TRichView editor.

It looks like gmail uses CSS and a RGB syntax when composing rich text emails from gmail.

here's the code gmail generated when I composed the email:

<div dir="ltr"><div><div><u><font size="6">Hi</font></u><br><br></div><span style="color:rgb(56,118,29)">Bye</span><br><br><br></div><b><span style="color:rgb(116,27,71)">Good Afternoon</span></b><br></div>

Can TRichView support this (css etc)?

The email looked like this when I composed it from gmail:

http://www.prositedev.com/tmp/view_from_gmail.pngl

but came into TRichView like this: (no text colors and some fonts not correctly):

http://www.prositedev.com/tmp/view_from_trichview.pngl

Any ideas for us to resolve?
Thank you much for your time,
Shawn [/url]

Posted: Fri Apr 11, 2014 2:55 am
by techmon
oops

I see the links for the screenshots I gave in the original post are bad.

try these:

The email looked like this when I composed it from gmail:

http://www.prositedev.com/tmp/view_from_gmail.png

but came into TRichView like this: (no text colors and some fonts not correctly):

http://www.prositedev.com/tmp/view_from_trichview.png

Posted: Sun Apr 13, 2014 5:06 am
by Sergey Tkachenko
You can load HTML in TRichView using TrvHtmlImporter and TrvHtmlViewImporter.

TrvHtmlImporter does not support CSS (it can load most of CSS saved by SaveHTMLEx, but does not support general CSS).

TrvHtmlViewImporter supports CSS.