How to render Asian characters in a PDF using xhtmlrenderer

Posted by Mark Derricutt on Stack Overflow See other posts from Stack Overflow or by Mark Derricutt
Published on 2009-11-08T21:58:02Z Indexed on 2010/05/29 23:02 UTC
Read the original article Hit count: 620

I was wondering what steps were needed to render Asian characters using the java based xhtmlrenderer (flying saucer) library?

I am wanting to render the following:

<html>
    <body>????????</body>
</html>

Without any font settings being added to the HTML this renders fine in normal browsers, but I can't find anyway to render this to PDF using the iTextRenderer portion of xhtmlrenderer.

After following various threads on the mailing list, I see lots of posts talking about adding .TTF files from the c:\windows\fonts directory, and I have modified the examples to run on linux ( https://gist.github.com/643173745182c9becc57 ), which shows me various fonts being displayed, but I don't see any Asian glyffs.

Does anyone have any decent pointers, or clean solutions to this problem? Or am I looking at the wrong problem with a really simple solution elsewhere?

© Stack Overflow or respective owner

Related posts about java

Related posts about pdf-generation