HTML span with unknown style variables has black background

Hi GemBox Team,

when I convert an HTML file with the following content to image or PDF the “Text in span” part seems to have a black background:

<html><body>
    <div dir="auto">
        Visible text
        <span style="color: var(--text-color); background: var(--bg-color);"dir="auto">
            Text in span
        </span>
    </div>
</body></html>

This is probably due to the style variables “text-color” and “bg-color” which are not defined in the document. When opening the file in the browser however, the text in span is visible and the background is not set to black. Is there a way to ignore the style variables if not set? Would the converted content then show the text as expected?

Kind regards,
Sarah

Hi Sarah,

Please try again with this bugfix:
https://www.gemboxsoftware.com/document/nightlybuilds/GBD35v1408.zip

Or this NuGet package:
Install-Package GemBox.Document -Version 35.0.1408-hotfix

Does this solve your issue?

Regards,
Mario

Hi Mario,

I am using GemBox.Bundle in my application and updated the package to 47.0.1108-hotfix, which includes GemBox.Document in version 35.0.1408-hotfix.
With the new GemBox.Bundle version my build shows warnings:

Warning NU1603 : GemBox.Bundle 47.0.1108-hotfix depends on GemBox.Imaging (>= 10.0.1073-hotfix) but GemBox.Imaging 10.0.1073-hotfix was not found. An approximate best match of GemBox.Imaging 10.0.1073 was resolved.

Could you take a look at this?

Kind regards,
Sarah

Thank you for letting us know about this issue, we’ll investigate it.

For now, can you check if the bugfix in GemBox.Bundle 47.0.1108-hotfix works for you?

The fix is working :slight_smile: All texts are now shown without black background.
Thank you!