Convert PDF to Word (DOCX) in C# and VB.NET

You can convert a PDF to a Word DOCX document with the GemBox.Document library using high-fidelity loading.

High-fidelity loading doesn't try to detect logical structure of the PDF document, instead it absolutely positions elements on the page. The saved DOCX file (or other file type) is then visually almost identical to the original PDF.

The following example shows how to do it in C# and VB.NET:

Upload your file (Drag file here)
using GemBox.Document;

class Program
{
    static void Main()
    {
        // If using the Professional version, put your serial key below.
        ComponentInfo.SetLicense("FREE-LIMITED-KEY");

        var document = DocumentModel.Load("%InputFileName%",
            new PdfLoadOptions()
            {
                LoadType = PdfLoadType.HighFidelity
            });

        document.Save("ConvertedFromPdf.docx");
    }
}
Imports GemBox.Document

Module Program

    Sub Main()

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

        Dim document = DocumentModel.Load("%InputFileName%",
            New PdfLoadOptions() With
            {
                .LoadType = PdfLoadType.HighFidelity
            })

        document.Save("ConvertedFromPdf.docx")
        
    End Sub
End Module
Screenshot of a Word DOCX document converted from a PDF file
Screenshot of a Word DOCX document converted from a PDF file

You can read more about the various types of loading PDF and how to choose one in the PDF loading article.

See also


Next steps

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. How about testing it today?

Download Buy