Search code examples
winformsc#-4.0base64chromium-embeddedcefsharp

Cefsharp LoadHtml throwing 'string too long'


I have been using loadhtml for some time now and its working fine for the simple thing I was using it for.

However, I recently started including images in my HTML in form of base64 and loadhtml doesn't like that and throughs string too long exception.

From what I understand so far that it's limited to ~2000 which is why it worked fine when the image was very small.

Is there a way to get around that?


Solution

  • You can embed HTML source in the project and read the project from the dlls into a string buffer. After that; use loadString method to load the required page.