Page 1 of 1

Wrapping text

PostPosted: Mon Mar 15, 2021 5:29 pm
by richolm
Hi

I have CEF sharp (wpf) working great for displaying HTML emails by passing the string using LoadHTML. Sometimes the emails are plain text and while cefsharp does display them it does not wrap the text to the window meaning for some emails you have to scroll a very long way to the right to see all the email. Long text urls are often the cause of this.

(I have googled this but google is obsessed with creating a cefsharp wrapper rather than wrapping text.)

Any help and hints appreciated

Rich

Re: Wrapping text

PostPosted: Mon Mar 15, 2021 6:40 pm
by richolm
Posting in case anyone else comes across this, just needed to add this

private void OnBrowserFrameLoadEnd(object sender, FrameLoadEndEventArgs args)
{
if (args.Frame.IsMain)
{
args
.Browser
.MainFrame
.ExecuteJavaScriptAsync(
"document.body.style.wordWrap = 'break-word'");
}
}