GemBox.Document is a .NET component that enables you to read, write, edit, convert, and print document files from your .NET applications using one simple API.

Convert Word, PDF and HTML files in C# and VB.NET

GemBox.Document enables you to easily convert documents into different file formats in C# and VB.NET. For example, you can convert Word or HTML files into a different Word format or into PDF, XPS, and image formats.

To do this, just load a Word document and save it into another file format as in the following example. For more details about supported document file formats in GemBox.Document, see Supported File Formats help page.

Screenshot
Convert Word to PDF Screenshot

See the full code below, use Run Example to execute.

Upload your file(Drag files here)

Download a sample file

using System;
using System.Linq;
using System.Text;
using GemBox.Document;
using GemBox.Document.Tables;
using System.Text.RegularExpressions;

class Sample
{
    [STAThread]
    static void Main(string[] args)
    {
        // If using Professional version, put your serial key below.
        ComponentInfo.SetLicense("FREE-LIMITED-KEY");

        DocumentModel document = DocumentModel.Load("Reading.doc");

        // In order to achieve the conversion of a loaded Word file to PDF,
        // or to some other Word format,
        // we just need to save a DocumentModel object to desired output file format.

        document.Save("Convert.docx");
    }
}
Imports System
Imports System.Linq
Imports System.Text
Imports GemBox.Document
Imports GemBox.Document.Tables
Imports System.Text.RegularExpressions

Module Samples

    Sub Main()

        ' If using Professional version, put your serial key below.
        ComponentInfo.SetLicense("FREE-LIMITED-KEY")

        Dim document As DocumentModel = DocumentModel.Load("Reading.doc")

        ' In order to achieve the conversion of a loaded Word file to PDF,
        ' or to some other Word format,
        ' we just need to save a DocumentModel object to desired output file format.
        document.Save("Convert.docx")

    End Sub

End Module

Check next sample.