Convert PDF files to image in C# and VB.NET

GemBox.Pdf enables you to easily convert PDF files into different file formats in C# and VB.NET. For example, you can convert PDF files into image formats (PNG, JPEG or other) and XPS.

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

Converting PDF files into image formats and XPS is currently supported on .NET Framework (and in future on .NET Core for Windows).

Converted PDF file to PNG image in C# and VB.NET
Screenshot of PNG image converted from PDF file
Upload your file (Drag file here)
using GemBox.Pdf;

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

        using (PdfDocument document = PdfDocument.Load("%InputFileName%"))
            // In order to achieve the conversion of a loaded PDF file to image,
            // we just need to save a PdfDocument object to desired image format.
            document.Save("Convert.%OutputFileType%");
    }
}
Imports GemBox.Pdf

Module Program

    Sub Main()

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

        Using document As PdfDocument = PdfDocument.Load("%InputFileName%")
            ' In order to achieve the conversion of a loaded PDF file to image,
            ' we just need to save a PdfDocument object to desired image format.
            document.Save("Convert.%OutputFileType%")
        End Using

    End Sub
End Module

Want more?

Next example GitHub

Check the next example or select an example from the menu. You can also download our examples from the GitHub.


Like it?

Download Buy

If you want to try the GemBox.Pdf yourself, you can download the free version. It delivers the same performance and set of features as the professional version, but with some operations limited. To remove the limitation, you need to purchase a license.