Hi,
have a look at this code:
List<string> ems = new List<string> { "0.5", "0.7", "0.900", "1.0", "1.1", "1.500", "2.0", "2.1" };
foreach (var em in ems)
{
try
{
string html = $"<span style=\"color: red; font-size: {em}em; \">ROT und Groß</span>";
Console.WriteLine(html);
Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook();
wb.Worksheets[0].Cells[1, 0].HtmlString = html;
Console.WriteLine($"working for {em}em");
}
catch (Exception ex)
{
Console.WriteLine($"NOT working for {em}em!!");
Console.WriteLine($"ERROR: {ex.Message}");
}
}
I am getting a “Font size is out of range.” error for all em values smaller than 1.0 when setting Cell.HtmlString.
I’ve testet with latest Aspose.Cells .Net version (22.6.1).
Thanks and best regards
Udo