Pdf to image: problems with special characters

Hello,

we are encountering a problem with generating images from some PDF files. In some cases the text is not rendered properly: special characters (german umlauts like äöü) are just skipped.

We are using version 5.4.0.0 of Aspose.PDF and 5.7.0.0 Apsose.Pdf.Kit

Our customer kindly provided a sample pdf file, that causes the problem, so we built a small demo application to demonstrate the behaviour.

Would you please provide any fix or possible workaround for this.

Thank you!

Hi Martin,

Thanks for contacting support.

I am afraid that you are using very old version of API. Whereas, we always recommend to use latest version of our API. Please also note that classes of Aspose.Pdf.Kit has also been merged into Aspose.Pdf for .NET. It is strongly recommended to use new DOM (Aspose.Pdf) approach as we are not resolving issues or providing support regarding old legacy approach.

I have converted your PDF file (demo.pdf) into image(s) of PNG format using DOM and latest version which is 17.2.0.0. The content of the document rendered correctly in the generated images. Please check the following code snippet which I have used for conversion process.

Document pdfDocument = new Document(dataDir + "demo.pdf");

for (int pageCount = 1; pageCount <= pdfDocument.Pages.Count; pageCount++)
{
    using (FileStream imageStream = new FileStream(dataDir + "image" + pageCount + "_out" + ".png", FileMode.Create))
    {
        Resolution resolution = new Resolution(300);
        PngDevice pngDevice = new PngDevice(resolution);
        pngDevice.Process(pdfDocument.Pages[pageCount], imageStream);
        imageStream.Close();
    }
}

I have also attached the generated output file(s) for your reference. You may check details about new DOM model in “Working with Aspose.Pdf” section of API document and for the latest release you may visit the “Downloads” page. In case if you need any further assistance please feel free to contact us.

Best Regards,