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

You can use PdfLoadType.HighFidelity to load a PDF file that should be converted to another file format.

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. You can read more about the various types of loading PDF and how to choose one in the PDF loading article.

The following example shows how you can convert a PDF file to DOCX with GemBox.Document using high-fidelity loading.

Screenshot of DOCX converted from PDF file
Screenshot of DOCX converted from PDF file
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

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