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 only on Windows (.NET Framework and .NET Core with enabled WPF).

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?
Like it?
Published: September 3, 2019 | Modified: October 7, 2020 | Author: Damir Stipinović