Using Aspose.net PDF purchased this year, I made an winform program which converts PDF first page to PNG file.
However, it threw an outofmemory error every time.
I found that there is a memory leak as shown in the below picture.
image.png (32.0 KB)
Please check the memory leak.
static pdfAspo.Document _pdfDocument;
static PngDevice _pngDevice;
using (FileStream imageStream = new FileStream(transFileNameTall, FileMode.CreateNew))
Resolution resolution = new Resolution(350);
// Create PNG device with specified attributes (Width, Height, Resolution) _pngDevice = new PngDevice(resolution); // Convert a particular page and save the image to stream _pngDevice.Process(_pdfDocument.Pages, imageStream); _pdfDocument.Pages.Dispose(); _pdfDocument.Dispose(); // Close stream imageStream.Close(); }