HTMLViewer.LoadHTML fails on Windows for HTML larger than 2 MB
- Status
- Fixed
- Fixed in
- v26.9.3
- Area
- desktop
- Last updated
- 2026-09-20
Upvotes
1 upvote
Uses your Objo forum account.
Public summary
On Windows, HTMLViewer.LoadHTML and assigning the HTML property fail with a runtime error ("Value does not fall within the expected range") when the HTML string is larger than about 2 MB. The same HTML loads correctly on macOS and Linux. Pages that embed images as base64 data URIs — the standard way to show local images in an HTML string, since a string-loaded document cannot read local files — are the common way to reach the limit, because base64 inflates the data by about a third and the whole document counts towards it.
Expected behaviour: LoadHTML accepts large HTML strings on Windows as well, or at minimum reports the size limit clearly in LastError instead of raising an opaque COM error.