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

Free Support Forum - aspose.com

Getting almost white page when converting PDF file to Png


I’m experiencing an issue when converting PDF file to Png.
The rendered png is almost empty / white.

Here is the code I run, with Aspose.Pdf in v20.3.0.0 :

    var pdfFilename = @"D:\TestFile.pdf";
    var pdfDocument = new Document(pdfFilename);
    int pageRank = 1;
    foreach (var pdfDocumentPage in pdfDocument.Pages)
        var pngFileName = pdfFilename.Replace(".pdf", $"-{pageRank}.png");
        using (var imageFileStream = new FileStream(pngFileName, FileMode.Create))
            var resolution = new Resolution(300);
            var pngDevice = new PngDevice(resolution);
            pngDevice.Process(pdfDocumentPage, imageFileStream);

And here is the pdf used; Facture 4137394.pdf (109.0 KB)


I have observed issue you mentioned and have logged it as PDFNET-47808 in our issue tracking system. We will further look into details of the 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.