ConvertHtmlToDocx(String,String) Метод (OpenXmlDocumentConverter)
Преобразует HTML документ в DOCX документ.
Этот C#/VB.NET код показывает, как преобразовать HTML документ в DOCX документ.
''' <summary>
''' Converts HTML document to a DOCX document.
''' </summary>
''' <param name="htmlFilePath">Path to a source HTML file.</param>
''' <param name="docxFilePath">Path to a result DOCX file.</param>
Public Shared Sub ConvertHtmlToDocx(htmlFilePath As String, docxFilePath As String)
Vintasoft.Imaging.Office.OpenXml.OpenXmlDocumentConverter.ConvertHtmlToDocx(htmlFilePath, docxFilePath)
End Sub
/// <summary>
/// Converts HTML document to a DOCX document.
/// </summary>
/// <param name="htmlFilePath">Path to a source HTML file.</param>
/// <param name="docxFilePath">Path to a result DOCX file.</param>
public static void ConvertHtmlToDocx(string htmlFilePath, string docxFilePath)
{
Vintasoft.Imaging.Office.OpenXml.OpenXmlDocumentConverter.ConvertHtmlToDocx(htmlFilePath, docxFilePath);
}
Целевые платформы: .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5