PngDevice creates blank image


#1

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.


#2

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


#3

@JW123

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.