privatestaticvoid MakeThumbnail(string filePath, string thumbPath)
{
//Load the document
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(filePath);
using (FileStream imageStream = newFileStream(thumbPath, FileMode.Create))
{
//Create PNG device with
specified resolution
Aspose.Pdf.Devices.Resolution resolution = new Aspose.Pdf.Devices.Resolution(300);
Aspose.Pdf.Devices.JpegDevice jpgDevice = new Aspose.Pdf.Devices.JpegDevice(resolution, 100);
//Convert page 1 and save the
image to stream
jpgDevice.Process(pdfDocument.Pages[1], imageStream);
//Close stream
imageStream.Close();
}
}