Png image does not show text- shows small rectangles instead

The following code tries to make png from a pdf.


private List convertPdfToPng() {
List imageIdList = null;
try {
imageIdList = new ArrayList();
PdfConverter converter = new PdfConverter();
converter.bindPdf(localFolder + fileName);
converter.setResolution(100);
converter.doConvert();

int i = 0;
while (converter.hasNextImage()) {
String imageId = “pdf-png-” + i++ + “.png”;
converter.getNextImage(localFolder + imageId, ImageType.PNG);
imageIdList.add(imageId);
}
System.out.println("Generated image as PDF file: " + fileName);
return imageIdList.size() == 0 ? null : imageIdList;
} catch (Throwable e) {

return null;
}
}


The png just shows small rectangles and no text. I am attaching both the src pdf and the generated pngs.

Any suggestions?

Thanks!

Hi,


Thanks
for using our products.

I
have tested the scenario and I am able to reproduce the same problem. For the
sake of correction, I have logged it in our issue tracking system as PDFKITJAVA-33260. We
will investigate this issue in details and will keep you updated on the status
of a correction.

We
apologize for your inconvenience.