Jpeg Plugin

Overview

The Aspose.Pdf.LowCode.Jpeg plugin renders PDF pages as JPEG images. Configure the operation with JpegOptions, set page selection or image quality when needed, add input and output data sources, and call Process.

Convert PDF to JPEG

// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void ConvertPdfToJpegWithPlugin()
{
    // The path to the documents directory
    var dataDir = RunExamples.GetDataDir_AsposePdf_WorkingDocuments();

    // Create PDF Jpeg plugin
    var plugin = new Aspose.Pdf.LowCode.Jpeg();

    // Configure JPEG conversion options
    var options = new Aspose.Pdf.LowCode.JpegOptions();
    options.OutputResolution = 300;
    options.Quality = 90;
    options.PageList = new System.Collections.Generic.List<int> { 1 };
    options.AddInput(new Aspose.Pdf.LowCode.FileDataSource(dataDir + "ConvertAllPagesToBmp.pdf"));
    options.AddOutput(new Aspose.Pdf.LowCode.FileDataSource(dataDir + "PdfToJpeg_out\\"));

    // Convert the file
    var result = plugin.Process(options);

    // Get the path of the first saved JPEG image
    var outputPath = result.ResultCollection[0].ToFile();
}

Options

Use OutputResolution to set image resolution, Quality to control JPEG compression, and PageList to choose pages.