Creating a Mapping from TrueType to CID

After you create the PDF4Printer, you need to create a mapping from the TrueType Japanese font to the CID Japanese font. The Adobe Asian Language Pack comes with two Japanese fonts, HeiseiMin-W3-Acro and HeiseiKakuGo-W5-Acro. Either can be used in the mapping.

The following is a complete list of CJK fonts that are supported:

HeiseiKakuGo-W5-Acro

HeiseiMin-W3-Acro

HYGoThic-Medium-Acro

HYSMyeongJo-Medium-Acro

HYSMyeongJoStd-Medium-Acro

KozMinPro-Regular-Acro

MHei-Medium-Acro

MSung-Light-Acro

MSungStd-Light-Acro

STSong-Light-Acro

STSongStd-Light-Acro

When the mapping has been properly configured, you can generate the PDF document as usual:

report.print(pdf.getPrintJob());

pdf.close();

CID fonts can be embedded in the generated document just like other TrueType fonts. Each CID font also has an additional CMap file. To embed the fonts, it is recommended that the CMap files also be embedded. Otherwise, the Asian language pack has to be installed on the viewer machine before the PDF document can be viewed.

pdf.setEmbedFont(true);

pdf.setEmbedCMap(true);

Note that for readers who are already CJK-enabled, setEmbedCMap should be set to false.

pdf.setEmbedCMap(false);

Because each CID font contains thousands of glyphs, embedding the entire font file will result in very large output files. Therefore, the font embedding in Style Intelligence extracts only the glyphs used in the current document and discards all other data to produce optimum size files. This process is more expensive than regular file embedding; therefore, generating CJK PDFs with font embedding will be slower than generating regular PDF files.

<< Specifying the CID Font Directory © 1996-2013 InetSoft Technology Corporation (v11.5) 3.8.2 Exporting to Excel Format Programmatically >>