Link Search Menu Expand Document

Convert DOCX to HTML - C#

PDF SDK sample in C# demonstrating ‘Convert DOCX to HTML’

Program.cs
using System.Diagnostics;
using Bytescout.PDF.Converters;

namespace ConvertDocxToHtml
{
    class Program
    {
        static void Main(string[] args)
        {
            using (DocxToHtmlConverter converter = new DocxToHtmlConverter())
            {
                converter.IndentHtmlCode = true;
                converter.WriteByteOrderMark = true;
                
                converter.ConvertDocxToHtml("sample.docx", "result.html", true);
            }

            // Open result document in default associated application (for demo purpose)
            ProcessStartInfo processStartInfo = new ProcessStartInfo("result.html");
            processStartInfo.UseShellExecute = true;
            Process.Start(processStartInfo);
        }
    }
}

Download Source Code (.zip)

Return to the previous page Explore PDF SDK


Copyright © 2016 - 2021 ByteScout