Hi folks!
com.aspose.words.Document.renderToSize() seems to have troubles rendering Unicode characters within the supplemental range. Instead of the Unicode characters, boxes are displayed (see the attached png image).
Attached to this message, three samples (doc, docx, odt) files which are working fine when extracting HTML (com.aspose.words.Document.save() with HtmlSaveOptions(SaveFormat.HTML)), but not when using com.aspose.words.Document.renderToSize()
This is a small issue, but if it could be handled in a future version of Aspose Words, this would be great!
Code snippet:
…
final BufferedImage image = new BufferedImage(renderWidth, renderHeight, BufferedImage.TYPE_INT_ARGB);
final Graphics2D gr = image.createGraphics();
gr.setColor(Color.WHITE);
gr.fillRect(0, 0, image.getWidth(), image.getHeight());
gr.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
doc.renderToSize(page, gr, 0, 0, renderWidth, renderHeight);
final ByteArrayOutputStream out = new ByteArrayOutputStream();
ImageIO.write(image, “png”, out);
…