The PDF file format is a standard for electronic documents with its security, ease of exchange, and high fidelity. Pdflib is a powerful package that is very popular internationally for generating PDF documents in batches on the server side. Many foreign governments, tax, banking, hydroelectric, and postal departments use their online production of documents and statements in PDF format.
For domestic users, how to use pdflib to output Simplified Chinese will be our most concerned problem. Here I will share some of their experience, wrong place please correct me, if I said in the Pdflib manual conflict, please refer to the manual. My mail is: bowriver2001@yahoo.ca.
For friends who have not contacted Pdflib, if you are interested, you can download the Pdflib package from this link. In the absence of license, you can still use all of its features, just the generated PDF document with Pdflib watermark.
Pdflib provides language interfaces for c,c++, Java, Perl, PHP, Python, TCL, and REALbasic. All of the following examples will take C.
How to use the Acrobat standard Simplified Chinese font
Pdflib with Stsong-light,adobesongstd-light-acro, and stsongstd-light-acro three kinds of Simplified Chinese fonts. These three fonts are also the Simplified Chinese standard font for Acrobat.
All of the above three fonts support the following encodings (Encoding): Unigb-ucs2-h,unigb-ucs2-v,unigb-utf16-h,unigb-utf16-v,gb-euc-h,gb-euc-v,gbpc-euc-h, Gbpc-euc-v,gbk-euc-h,gbk-euc-v,gbkp-euc-h,gbkp-euc-v,gbk2k-h, and Gbk2k-v. For the definition of each encoding, see table 1.1 below:
Table 1.1
Encoding |
Character Set and text format |
Unigb-ucs2-h Unigb-ucs2-v |
Unicode (UCS-2) encoding for the ADOBE-GB1 character collection |
Unigb-utf16-h Unigb-utf16-v |
Unicode (UTF-16BE) encoding for the ADOBE-GB1 character collection. Contains mappings for all characters in the gb18030-2000 character set. |
Gb-euc-h Gb-euc-v |
Microsoft Code Page 936 (CharSet 134), GB 2312-80 character set, EUC-CN encoding |
Gbpc-euc-h Gbpc-euc-v |
Macintosh, GB 2312-80 character set, EUC-CN encoding, Script Managercode 2 |
Gbk-euc-h Gbk-euc-v |
Microsoft Code Page 936 (CharSet 134), GBK character set, GBK encoding |
Gbkp-euc-h Gbkp-euc-v |
Same as Gbk-euc-h, but replaces half-width Latin characters withproportional forms and maps code 0x24 to Dollar ($) Instea D of Yuan (¥). |
Gbk2k-h Gbk2k-v |
GB 18030-2000 Character Set, mixed 1-, 2-, and 4-byte encoding |