VintaSoft Imaging .NET SDK 14.0: Документация для .NET разработчика
В этом разделе
    Кодеки: Как преобразовать HTML в DOCX?
    В этом разделе
    SDK может преобразовывать HTML документ в DOCX документ.

    SDK поддерживает следующие HTML-теги: a, abbr, acronym, article, b, big, blockquote, body, br, caption, center, code, col, colgroup, dd, div, dl, dt, em, embed, figcaption, figure, font, footer, h1, h2, h3, h4, h5, h6, header, hr, i, img, li, ol, p, pre, q, s, section, small, span, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul .

    SDK поддерживает следующие CSS-атрибуты: background-color, border, border-bottom, border-bottom-color, border-bottom-style, border-bottom-width, border-collapse, border-color, border-left, border-left-color, border-left-style, border-left-width, border-right, border-right-color, border-right-style, border-right-width, border-style, border-top, border-top-color, border-top-style, border-top-width, border-width, color, display, font, font-family, font-size, font-style, font-variant, font-weight, height, line-height, list-style-type, margin, margin-block-end, margin-block-start, margin-bottom, margin-left, margin-right, margin-top, maring-inline-end, maring-inline-start, padding, padding-bottom, padding-left, padding-right, padding-top, page-break-before, text-align, text-decoration, text-decoration-color, text-decoration-line, text-decoration-style, text-decoration-thickness, text-indent, text-transform, vertical-align, white-space, width .
    CSS-атрибуты поддерживаются только в атрибуте "style" HTML-тега. Внешние CSS-стили пока не поддерживаются.

    Вот C#/VB.NET код, который показывает, как преобразовать HTML документ в DOCX документ:
    /// <summary>
    /// Converts HTML document to a DOCX document.
    /// </summary>
    public static void ConvertHtmlToDocx(string htmlFilePath, string docxFilePath)
    {
        Vintasoft.Imaging.Office.OpenXml.OpenXmlDocumentConverter.ConvertHtmlToDocx(htmlFilePath, docxFilePath);
    }
    
    ''' <summary>
    ''' Converts HTML file to a DOCX file.
    ''' </summary>
    Public Shared Sub ConvertHtmlToDocx(htmlFilePath As String, docxFilePath As String)
        Vintasoft.Imaging.Office.OpenXml.OpenXmlDocumentConverter.ConvertHtmlToDocx(htmlFilePath, docxFilePath)
    End Sub