StackOverflowException in HTML with font-size definition

Hi GemBox Team,

I have the following HTML document, that contains a style for the complete document for the font-size in rem:

<html>
 <head>
  <style>
   html { font-size: 1rem; }
  </style>
 </head>
 <body> 
  <p>Test</p>
 </body>
</html>

Loading it as DocumentModel causes a StackOverflowException with this StackTrace:

   at (⸮)
   at +.(⸮)
   at .(⸮, Double ByRef)
   at (GemBox.Document.CharacterFormat, ⸮, Boolean, Boolean)
   at .(, GemBox.Document.Section)
   at .)
   at .(System.IO.Stream, , System.Text.Encoding, System.String)
   at .(System.IO.Stream, System.String, GemBox.Document.HtmlLoadOptions)(S
   at GemBox.Document.HtmlLoadOptions.7k4lmxmhj5tk8h83eglk6fss34tasuhnystem.IO.Stream, System.String)
   at GemBox.Document.DocumentModel.Load(System.String, GemBox.Document.LoadOptions)
   at GemBox.Document.DocumentModel.Load(System.String)

Changing the unit of font-size (to “px” instead of “rem”) or the scope of the style (to “body” instead of “html”) avoids the exception.

I am using GemBox.Bundle in version 2025.3.134-hotfix.

Could you have a look at this behaviour?

Regards,
Sarah

Hi Sarah,

Please try again with this NuGet package:

Install-Package GemBox.Document -Version 2025.3.126-hotfix

Note that this is a hidden (unlisted) version. To install it, you’ll need to run the above command on the NuGet Package Manager Console (Tools → NuGet Package Manager → Package Manager Console).

Does this solve your issue?

Regards,
Mario

Hi Mario,

the version 2025.3.126-hotfix did not solve it, but the newer version of today (2025.3.139-hotfix) worked. Thank you :slightly_smiling_face:

Regards,
Sarah

Hi Sarah,

That is a version of GemBox.Bundle, not GemBox.Document.
Nevertheless, I’m glad to hear that the issue is now resolved.

Regards,
Mario

Hi Mario,

Ah I see - my mistake, sorry!

Regards,
Sarah