.net6 aspose.pdf 21.3 has a problem

using Aspose.Pdf;
using Aspose.Pdf.Devices;
using Aspose.Pdf.Facades;

Console.WriteLine(“Hello, World!”);

var filepath1 = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, “Files\111.pdf”);

Document document = new Document(filepath1);

Resolution resolution = new Resolution(300);
JpegDevice jpegDevice = new JpegDevice(resolution);
ConvertPDFtoImage(jpegDevice, document);
Console.ReadLine();

static void ConvertPDFtoImage(ImageDevice imageDevice,
Document pdfDocument)
{
var path = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, “Files\111.jpg”);
for (int pageCount = 1; pageCount <= pdfDocument.Pages.Count; pageCount++)
{
using (FileStream imageStream =
new FileStream($"{path}",
FileMode.Create))
{
// Convert a particular page and save the image to stream
imageDevice.Process(pdfDocument.Pages[pageCount], imageStream);

        // Close stream
        imageStream.Close();
    }
}

}

debug result
System.Exception:“Exception_WasThrown”

@yechaoyechao

The .NET 6.0 support was added in 21.11 version of the API. Please upgrade your API version in order to get the code working. In case you still notice any issues, please let us know.