onizet / html2openxml

Html2OpenXml is a small .Net library that convert simple or advanced HTML to plain OpenXml components. This program has started in 2009, initially to convert user's comments into templated Word.
MIT License
321 stars 109 forks source link

Getting error Value cannot be null. Parameter name: method #89

Closed anilmaskara closed 3 years ago

anilmaskara commented 3 years ago

Getting error Value cannot be null. Parameter name: method on following line HtmlConverter converter = new HtmlConverter(mainPart);

This is happening with DocumentFormat.OpenXml 2.11.3.

Working fine with DocumentFormat.OpenXml 2.10.1

twsouthwick commented 3 years ago

You probably are using an out of date version of this library. The library uses an internal API of DocumentFormat.OpenXml that has been renamed and refactored a few times. See https://github.com/onizet/html2openxml/issues/70 for a similar issue.

I recently pushed an update to DocumentFormat.OpenXml that provides an API to remove the need for reflection and should remove this error from happening in the future. See #90 for the fix for this library.