HtmlConverter - Unhandled Exception

Mar 24, 2014 at 12:10 PM
I’ll try to convert a docx-document into a html-document. The word-file was created with the docx library (https://docx.codeplex.com/) on a system where no Word-Instance is installed.

When I try to simply convert the docx-document, my program breaks.

The error can be traced into the following method:
private static object CalculateSpanWidthTransform(XNode node, int defaultTabStop)

When I diactivate the second recursive call of the method, the program works.
}
                    else
                    {
                        return new XElement(element.Name,
                            element.Attributes(),
                            element.Nodes().Select(n => CalculateSpanWidthTransform(n, defaultTabStop)));
                    }
                }

                //return new XElement(element.Name,
                //    element.Attributes(),
                //    element.Nodes().Select(n => CalculateSpanWidthTransform(n, defaultTabStop)));
            }
        return node;
    }