How to convert DOCX to HTML using ByteScout PDF SDK - ByteScout

How to convert DOCX to HTML using ByteScout PDF SDK

  • Home
  • /
  • Articles
  • /
  • How to convert DOCX to HTML using ByteScout PDF SDK

The example demonstrates how to convert Microsoft Word DOCX document to HTML file using ByteScout PDF SDK. If you follow basic steps for converting into HTML, that would be easy to release a necessary document via extensive PDF API.

Program.vb:
VB

'*******************************************************************
'       ByteScout PDF SDK
'                                                                   
'       Copyright © 2016 Bytescout, https://bytescout.com        
'       ALL RIGHTS RESERVED                                         
'                                                                   
'*******************************************************************

Imports System.IO
Imports Bytescout.PDF.Converters

''' <summary>
''' This example demonstrates how to convert Microsoft Word DOCX document to HTML file.
''' </summary>
Class Program

    Shared Sub Main()

        ' Create converter instance
        Using converter As New DocxToHtmlConverter()

            ' Perform conversion
            converter.ConvertDocxToHtml("sample.docx", "result.html", False)

        End Using

        ' Open result document in Internet Explorer
        Process.Start("iexplore.exe", Path.GetFullPath("result.html"))

    End Sub

End Class

Program.cs:
C#

//*******************************************************************
//       ByteScout PDF SDK		                                     
//                                                                   
//       Copyright © 2016 ByteScout - https://bytescout.com       
//       ALL RIGHTS RESERVED                                         
//                                                                   
//*******************************************************************

using System.Diagnostics;
using System.IO;
using Bytescout.PDF.Converters;

namespace ConvertDocxToHtml
{
	/// <summary>
	/// This example demonstrates how to convert Microsoft Word DOCX document to HTML file.
	/// </summary>
	class Program
	{
		static void Main()
		{
            // Create converter instance
		    using (DocxToHtmlConverter converter = new DocxToHtmlConverter())
		    {
                // Perform conversion
		        converter.ConvertDocxToHtml("sample.docx", "result.html", false);
		    }

		    // Open result document in Internet Explorer
		    Process.Start("iexplore.exe", Path.GetFullPath("result.html"));
		}
	}
}

Tutorials:

prev
next