.net-coreopenxml-powertools

Convert Doc to HTML in .NET Core without OpenXmlPowerTools


I am converting .NET 4.5 project to .NET Core 2.2 and I am trying to find an alternative to OpenXmlPowerTools which is not supporting .NET Core yet.

I tried Net-Core-DocX-HTML-To-PDF-Converter from https://github.com/smartinmedia/Net-Core-DocX-HTML-To-PDF-Converter and it works fine. But I'm not allowed to use this since it is involved with .exe

I also found few alternatives that works if I target project to .NET Standard which I am not supposed to.

Below is the piece of code that uses OpenXmlPowerTools. I am trying to achieve without OpenXmlPowerTools

                    HtmlConverterSettings settings = new HtmlConverterSettings()
                    {
                        PageTitle = "TEST DOCUMENT"
                    };

                    XElement htmlX = HtmlConverter.ConvertToHtml(doc, settings);
                    DocinHtml = htmlX.ToStringNewLineOnAttributes();

Can you please suggest or recommend any other plugin/Components that I can use to just convert DOC to HTML format?


Solution

  • You can use the OpenXmlPowerTools-NetStandard Nuget Package. It is a fork of OpenXmlPowerTools targeting .net standard 2.0.