This project is read-only.
2
Vote

FormatException Error in HtmlConverter.cs

description

In HtmlConverter.cs you might get an FormatException error message at the following lines within ConvertToHtmlTransform(), s. also attachments:
  1. ...
    var tabWidth = (decimal)tabWidthAtt; //<------ Error here
    ...
  2. ...
    var tabWidth = (decimal?)element.Attribute(PtOpenXml.TabWidth); //<------ Error here
    ...
It happens because of the casting of the Attribute object to decimal. This should be changed to:
  1. var tabWidth = Convert.ToDecimal(tabWidthAtt.Value);
  2. if (element.Attribute(PtOpenXml.TabWidth) != null)
    {
    decimal tabWidth;
    Decimal.TryParse(element.Attribute(PtOpenXml.TabWidth).Value, out tabWidth);
    ...
    }
    {...}

file attachments

comments