References are missing

Document pdfDocument = new Document("input.pdf");

for (int pageCount = 1; pageCount <= pdfDocument.Pages.Count; pageCount++)
{
using (FileStream imageStream = new FileStream(“image” + pageCount + “.jpg”, FileMode.Create))
{
// Create Resolution object
Resolution resolution = new Resolution(300);
// Create JPEG device with specified attributes (Width, Height, Resolution, Quality)
// where Quality [0-100], 100 is Maximum
JpegDevice jpegDevice = new JpegDevice(resolution, 100);

    // Convert a particular page and save the image to stream
    jpegDevice.Process(pdfDocument.Pages[pageCount], imageStream);
    // Close stream
    imageStream.Close();
}

}


Hi there,


Thanks for your inquiry. Please reference Aspose.Pdf for .NET API DLL as per your project target .NET Framework in your Project. Later you may import the Aspose.Pdf and Aspose.Pdf.Devices namespaces in your project or resolve couplet object reference in your code as following for the subjected error rectification. Hopefully it will help you to resolve the issue.

Aspose.Pdf.Document
pdfDocument = new Aspose.Pdf.Document(“input.pdf”);
<o:p></o:p>

for (int pageCount = 1; pageCount <= pdfDocument.Pages.Count; pageCount++)

{ using (FileStream imageStream = new FileStream("image" + pageCount + ".jpg", FileMode.Create))

{

// Create Resolution object

Aspose.Pdf.Devices.Resolution resolution = new Aspose.Pdf.Devices.Resolution(300);

// Create JPEG device with specified attributes (Width, Height, Resolution, Quality)

// where Quality [0-100], 100 is Maximum

Aspose.Pdf.Devices.JpegDevice jpegDevice = new Aspose.Pdf.Devices.JpegDevice(resolution, 100);

// Convert a particular page and save the image to stream

jpegDevice.Process(pdfDocument.Pages[pageCount], imageStream);

// Close stream

imageStream.Close();

}

}


Please feel free to contact us for any further assistance.

Best Regards,