HTML
JPG
PDF
XML
PDF
JPEG
Convert PDF to JPEG Image via C#
Export PDF documents to multiple images including JPEG using .NET API.
How to Convert PDF to JPEG Images Using C#
In order to convert PDF to JPEG Image, we’ll use Aspose.PDF for .NET API which is a feature-rich, powerful and easy to use document manipulation and conversion API for C# platform. Open NuGet package manager, search for Aspose.PDF and install. You may also use the following command from the Package Manager Console.
Package Manager Console Command
PM> Install-Package Aspose.PDF
Steps to Convert PDF to JPEG via C#
.NET developers can easily load & convert PDF files to JPEG in just a few lines of code.
- Load PDF file with an instance of Document class
- Create & set the instance of JpegDevice class with Size & Resolution
- Call JpegDevice.Process method with page index & output file path as parameters
System Requirements
Before running the PDF conversion to Images C# sample code, make sure that you have the following prerequisites.
- Microsoft Windows or a compatible OS with .NET Framework, .NET Core, and PHP, VBScript, Delphi, C++ via COM Interop.
- Development environment like Microsoft Visual Studio.
- Aspose.PDF for .NET DLL referenced in your project.
This sample code shows PDF to JPEG image C# Conversion
// load PDF with an instance of Document
var document = new Document("template.pdf");
// create an object of jpegDevice
var renderer = new Aspose.Pdf.Devices.JpegDevice();
// convert a particular page and save the image in JPEG format
renderer.Process(document.Pages[1], "output.jpeg");