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

Free Support Forum - aspose.com

Creating image from PDF fails to render text

I’m generating a preview image of a PDF using PngDevice. None of the text in this PDF is rendered to the image.


I’ve attached the sample PDF and the image output.

I’m using the following code to generate the image:
            MemoryStream stream = new MemoryStream();
Document pdfDocument = new Document(sourceFileInfo.FullFilePath);
        <span style="color: rgb(43, 145, 175); ">Page</span> firstPage = pdfDocument.Pages.Cast<<span style="color: rgb(43, 145, 175); ">Page</span>>().First();
        <span style="color: rgb(43, 145, 175); ">PngDevice</span> pngDevice = <span style="color: blue; ">new</span> <span style="color: rgb(43, 145, 175); ">PngDevice</span>((<span style="color: blue; ">int</span>)firstPage.MediaBox.Width, (<span style="color: blue; ">int</span>)firstPage.MediaBox.Height);

        pngDevice.Process(firstPage, stream);</pre></div>

Hi Muppetsuk,

I have tested the scenario and I am able to notice the same problem. For the sake of correction, I have logged this problem as PDFNEWNET-32485 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction.

We apologize for your inconvenience.

Thanks & Regards,

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