Document pdfDocument = new Document(“1152.pdf”);
foreach (Page page in pdfDocument.Pages)
{
using (FileStream imageStream = new FileStream(“14612.jpg”, FileMode.Create))
{
Aspose.Pdf.Devices.Resolution resolution = new Aspose.Pdf.Devices.Resolution(Convert.ToInt32(page.ArtBox.Width), Convert.ToInt32(page.ArtBox.Height));
Aspose.Pdf.Devices.JpegDevice jpegDeviceLarge = new Aspose.Pdf.Devices.JpegDevice(resolution);
jpegDeviceLarge.RenderingOptions.InterpolationHighQuality = true;
jpegDeviceLarge.RenderingOptions.UseNewImagingEngine = true;
jpegDeviceLarge.Process(page, imageStream);
}
}
1152.pdf (771.4 KB)
14612.jpg (85.9 KB)
It’s a program that converts pdf to jpg, but jpg is actually longer than pdf.