We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

PngDevice creates blank image

Hi. I want to create an image file of a PDF page, but with some PDF files, all I get is a blank image. The image is the correct size, but it is just white. With other PDF files, the output image is fine. What can I do to ensure I always get a good image?
I am using the following code to generate the image. I have attached an example PDF and example Visual Studio solution.

    var pdfDocument = new Document(@"..\..\OnePagePdf.pdf");
    var pngDevice = new PngDevice(new Resolution(200));
    using (var fileStream = File.Open(@"..\..\OnePagePdf.png", FileMode.Create))
        pngDevice.Process(pdfDocument.Pages[1], fileStream);

Thanks for your help.

ConsoleApp17.zip (33.3 KB)
OnePagePdf.pdf (82.9 KB)


We were able to replicate the issue in our environment and have logged it as PDFNET-47234 in our issue tracking system. We will further investigate the reasons behind this issue and keep you posted with the status of its correction. Please be patient and spare us little time.

We are sorry for the inconvenience.

Six months later and issue still persists in version 20.5.0


We regret to share that the ticket is not yet resolved due to low priority and other high priority issues in the queue. We will surely inform you as soon as we have some definite updates about resolution of the ticket. Please spare us some time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as PDFNET-47234) have been fixed in Aspose.PDF for .NET 22.5.