17.05.2014 Views

PDFlib 8 Windows COM/.NET Tutorial

PDFlib 8 Windows COM/.NET Tutorial

PDFlib 8 Windows COM/.NET Tutorial

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.3 Chinese, Japanese, and Korean Encodings<br />

Historically, a wide variety of CJK encoding schemes have been developed by diverse<br />

standards bodies and companies. Fortunately, all prevalent encodings are supported by<br />

Acrobat and PDF by default. Since the concept of an encoding is much more complicated<br />

for CJK text than for Latin text, simple 8-bit encodings no longer suffice. Instead,<br />

PostScript and PDF use the concept of character collections and character maps (CMaps)<br />

for organizing the characters in a font.<br />

Predefined CMaps for common CJK encodings. The predefined CJK CMaps are listed in<br />

Table 4.3. As can be seen from the table, they support most CJK encodings used on Mac,<br />

<strong>Windows</strong>, and Unix systems, as well as several vendor-specific encodings, e.g. Shift-JIS,<br />

EUC, and ISO 2022 for Japanese, GB and Big5 for Chinese, and KSC for Korean. Unicode is<br />

supported for all locales as well.<br />

Table 4.3 Predefined CMaps for Japanese, Chinese, and Korean text (from the PDF Reference)<br />

locale CMap name character set and text format<br />

Simplified<br />

Chinese<br />

Traditional<br />

Chinese<br />

UniGB-UCS2-H<br />

UniGB-UCS2-V<br />

UniGB-UTF16-H<br />

UniGB-UTF16-V<br />

UniCNS-UCS2-H<br />

UniCNS-UCS2-V<br />

UniCNS-UTF16-H<br />

UniCNS-UTF16-V<br />

Unicode (UCS-2) encoding for the Adobe-GB1 character collection<br />

Unicode (UTF-16BE) encoding for the Adobe-GB1 character collection. Contains<br />

mappings for all characters in the GB18030-2000 character set.<br />

Unicode (UCS-2) encoding for the Adobe-CNS1 character collection<br />

Unicode (UTF-16BE) encoding for the Adobe-CNS1 character collection. Contains<br />

mappings for all of HKSCS-2001 (2- and 4-byte character codes)<br />

Japanese UniJIS-UCS2-H, -V Unicode (UCS-2) encoding for the Adobe-Japan1 character collection<br />

UniJIS-UCS2-HW-H<br />

UniJIS-UCS2-HW-V<br />

UniJIS-UTF16-H<br />

UniJIS-UTF16-V<br />

Same as UniJIS-UCS2-H, but replaces proportional Latin characters with halfwidth<br />

forms<br />

Unicode (UTF-16BE) encoding for the Adobe-Japan1 character collection. Contains<br />

mappings for all characters in the JIS X 0213:1000 character set.<br />

Korean UniKS-UCS2-H, -V Unicode (UCS-2) encoding for the Adobe-Korea1 character collection<br />

UniKS-UTF16-H, -V Unicode (UTF-16BE) encoding for the Adobe-Korea1 character collection<br />

Note Unicode-aware language bindings support only Unicode CMaps (UCS2 or UTF16). Other CMaps<br />

can not be used (see Section 4.4.2, »Strings in Unicode-aware Language Bindings«, page 109).<br />

CJK text encoding for standard CMaps. The client is responsible for supplying text encoded<br />

such that it matches the requested CMap. <strong>PDFlib</strong> checks whether the supplied<br />

text conforms to the requested CMap, and will raise an exception for bad text input<br />

which doesn’t conform to the selected CMap.<br />

CMap configuration. In order to create Chinese, Japanese, or Korean (CJK) text output<br />

with one of the predefined CMaps <strong>PDFlib</strong> requires the corresponding CMap files for processing<br />

the incoming text and mapping CJK encodings to Unicode. The CMap files are<br />

available in a separate package. They should be installed as follows:<br />

> On <strong>Windows</strong> the CMap files will be found automatically if you place them in the<br />

resource/cmap directory within the <strong>PDFlib</strong> installation directory.<br />

> On other systems you can place the CMap files at any convenient directory, and<br />

must manually configure the CMap files by setting the SearchPath at runtime:<br />

104 Chapter 4: Unicode and Legacy Encodings (Edition for <strong>COM</strong>, .<strong>NET</strong>, and REALbasic)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!