Hello,
I think you are mixing two different things.
Tommy Cheng wrote:
> However, I still can't display the Chinese characters
> with iTextAsian.jar.
iTextAsion.jar is for fonts that aren't embedded.
Even if you set embedded=true, they won't be in the PDF.
This is explained in section 8.3.2 of the iText book.
You can find the list of fonts in the iTextAsian.jar
in Table 8.5 (page 250).
> Below is the code I write. The first one is that I
> embed our custom font with INDENTITY_H where the
> second one is following the suggestion with
> iTextAsian.jar
IDENTITY_H is not supported for the fonts in
iTextAsian.jar, use the CMap names listed in
Table 8.5.
> BaseFont bfComic =
> BaseFont.createFont("./HA_Mingliu.ttf",
> BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
> Font font = new Font(bfComic, 12);
Using HA_mingliu.ttf doesn't require iTextAsian.jar.
It needs the ttf file HA_mingliu.ttf in the appropriate
path. My guess is that this is an OpenType font with
TrueType outlines. Your example is similar to the one
in section 8.3.3 of the book. A subset of the font will
be embedded.
> BaseFont bfComic = BaseFont.createFont("MSung-Light",
> "UniCNS-UCS2-H", BaseFont.EMBEDDED);
Here you are using a CJK font correctly.
As documented in the iText book AND the PDF Reference:
these fonts will never be embedded. This is not a bug;
this is how it was designed by Adobe.
Adobe Reader will detect that such a font was used,
and ask the end user to download a font pack.
best regards,
Bruno
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/