> -----Original Message-----
> From: HIYAMA Yumiko [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, February 17, 2003 6:37
> To:   [EMAIL PROTECTED]
> Subject:      [iText-questions] I can't encording Japanese
> 
> Hi,All
> 
>  I have been trying to use i-Text to display Japanese, but
> I still couldn't.  I get bytes from String and then I
> converted it using following code, but all characters
> displayed as "????".   Altough I refer to archive
> No:msg03203.html, I cannot understand this problem.
>  If somebody knows where I made mistake and right way to
> display Japanese, I really want to your help..
> 
> String jp = "--Japanese character--";
> byte[]  b = jp.getBytes();
> String cemo = new String(b, "EUC_JP");
>  
> 
        jp has the Unicode string (if it's well formed), you don't need the
other 2 lines.
        By the way, with itext-paulo-108 you can have a lot more japanese
characters. Here's an extract of the encodings directly supported:


        # cid2code.txt (Version 01/25/2003)
        #
        # The data in this table contains 28 tab-delimited columns of
        # information. The contents of this file supplement Technical Notes
        # #5078 "Adobe-Japan1-4 Character Collection for CID-Keyed Fonts"
        # and #5146 "Adobe-Japan1-5 Character Collection for CID-Keyed
        # Fonts (Addendum)":
        #
        # http://partners.adobe.com/asn/developer/technotes.html
        #
        # This table contains lists CIDs 0 through 20316 in the first
column,
        # and provides additional columns that indicate whether a CID is
used
        # in a particular CMap file, and if so, provides the encoded
        # value. Here are some common aspects of the data that you will find
        # in this table:
        #
        # o All character codes are provided in hexadecimal notation.
        #
        # o Many of the CMap files indicated at the head of each column have
        #   both "-H" (horizontal writing mode) and "-V" (vertical writing
        #   mode) versions. Those with only a "-H" version are explicitly
        #   shown with the "-H" appended. Those with both do not have a
        #   writing mode suffix.
        #
        # o The character codes found in a corresponding "-V" (vertical
        #   writing mode) CMap file are indicated by a "v" appended to the
        #   hexadecimal code.
        #
        # o There may be cases of single CIDs being referenced in multiple
        #   encoding points within a single CMap file. These cases are
        #   comma-delimited, within the same column.
        #
        # The following is a synopsis of columns 2 through 25, and provides
        # information about character set and encoding:
        #
        # o Column 2: Character codes for the "H" and "V" CMaps (JIS X
        #   0208:1997 character set, ISO-2022-JP encoding).
        #
        # o Column 3: Character codes for the "RKSJ-H" and "RKSJ-V" CMaps
(JIS
        #   X 0208:1997 character set, Shift-JIS encoding, half-width Latin
        #   characters).
        #
        # o Column 4: Character codes for the "EUC-H" and "EUC-V" CMaps (JIS
        #   X 0208:1997 character set, EUC-JP encoding, half-width Latin
        #   characters).
        #
        # o Column 5: Character codes for the "83pv-RKSJ-H" CMap (KanjiTalk
        #   Version 6 character set, Shift-JIS encoding, proportional Latin
        #   characters).
        #
        # o Column 6: Character codes for the "Add-H" and "Add-V" CMaps
        #   (Fujitsu character set, ISO-2022-JP encoding, half-width Latin
        #   characters).
        #
        # o Column 7: Character codes for the "Add-RKSJ-H" and "Add-RKSJ-V"
        #   CMaps (Fujitsu character set, Shift-JIS encoding, half-width
Latin
        #   characters).
        #
        # o Column 8: Character codes for the "Ext-H" and "Ext-V" CMaps (NEC
        #   character set, ISO-2022-JP encoding, half-width Latin
characters).
        #
        # o Column 9: Character codes for the "Ext-RKSJ-H" and "Ext-RKSJ-V"
        #   CMaps (NEC character set, Shift-JIS encoding, half-width Latin
        #   characters).
        #
        # o Column 10: Character codes for the "NWP-H" and "NWP-V" CMaps
(NEC
        #   Bungo character set, ISO-2022-JP encoding).
        #
        # o Column 11: Character codes for the "90pv-RKSJ-H" and
"90pv-RKSJ-V"
        #   CMap (KanjiTalk Version 7 character set, Shift-JIS encoding,
        #   proportional Latin characters).
        #
        # o Column 12: Character codes for the "90ms-RKSJ-H" and
"90ms-RKSJ-V"
        #   CMaps (Microsoft Windows 3.1J & 95J character set, Shift-JIS
        #   encoding, half-width Latin characters).
        #
        # o Column 13: Character codes for the "90msp-RKSJ-H" and
"90msp-RKSJ-V"
        #   CMaps (Microsoft Windows 3.1J & 95J character set, Shift-JIS
        #   encoding, proportional Latin characters).
        #
        # o Column 14: Character codes for the "78-H" and "78-V" CMaps (JIS
C
        #   6226-1978 character set, ISO-2022-JP encoding, half-width Latin
        #   characters).
        #
        # o Column 15: Character codes for the "78-RKSJ-H" and "78-RKSJ-V"
        #   CMaps (JIS C 6226-1978 character set, Shift-JIS encoding,
        #   half-width Latin characters).
        #
        # o Column 16: Character codes for the "78ms-RKSJ-H" and
"78ms-RKSJ-V"
        #   CMaps (Microsoft Windows 3.1J & 95J character set, JIS C
6226-1978
        #   glyphs, Shift-JIS encoding, half-width Latin characters).
        #
        # o Column 17: Character codes for the "78-EUC-H" and "78-EUC-V"
CMaps
        #   (JIS C 6226-1978 character set, EUC-JP encoding, half-width
Latin
        #   characters).
        #
        # o Column 18: Character codes for the "UniJIS-UCS2-H" and
        #   "UniJIS-UCS2-V" CMaps (Unicode UCS-2 encoding, proportional
Latin
        #   characters). (NOTE: These two CMap files are no longer being
        #   maintained. The use of the UTF-8, UTF-16, and UTF-32 CMap files
        #   is recommended.)
        #
        # o Column 19: Character codes for the "UniJIS-UCS2-HW-H" and
        #   "UniJIS-UCS2-HW-V" CMaps (Unicode UCS-2 encoding, half-width
        #   Latin characters). (NOTE: These two CMap files are no longer
        #   being maintained. The use of the UTF-8, UTF-16, and UTF-32 CMap
        #   files is recommended.)
        #
        # o Column 20: Character codes for the "UniJIS-UTF8-H" and
        #   "UniJIS-UTF8-V" CMaps (Unicode 3.2 UTF-8 encoding, proportional
        #   Latin characters).
        #
        # o Column 21: Character codes for the "UniJIS-UTF16-H" and
        #   "UniJIS-UTF16-V" CMaps (Unicode 3.2 UTF-16 encoding,
proportional
        #   Latin characters).
        #
        # o Column 22: Character codes for the "UniJIS-UTF32-H" and
        #   "UniJIS-UTF32-V" CMaps (Unicode 3.2 UTF-32 encoding,
proportional
        #   Latin characters).
        #
        # o Column 23: Character codes for the "UniJISX0213-UTF32-H" and
        #   "UniJISX0213-UTF32-V" CMaps (Unicode 3.2 UTF-32 encoding,
        #   proportional Latin characters, some proportional JIS X 0208:1997
        #   characters).
        #
        # o Columns 24-28: The CMap files for these five columns specify
one-
        #   byte encodings only: Hiragana, Katakana, Hankaku, Roman, and WP-
        #   Symbol.
        #
        # NOTE: The three "Pro" CMap files differ from their non-Pro
        #       counterparts as follows:
        #
        #                    UniJISPro-UCS2-V  UniJIS-UCS2-V
        #       U+2018       12173             8281
        #       U+2019       12174             8282
        #       U+201C        7956             8279
        #       U+201D        7957             8280
        #       U+337B       12044              n/a
        #       U+337C       12043              n/a
        #       U+337D       12042              n/a
        #       U+337E       12041              n/a
        #       U+FF1A       12101              n/a
        #
        #       The UniJISPro-UCS2-HW-V and UniJIS-UCS2-HW-V CMap files
share
        #       the same differences.
        #
        #                    UniJISPro-UTF8-V  UniJIS-UTF8-V
        #       0xE28098     12173             8281
        #       0xE28099     12174             8282
        #       0xE2809C      7956             8279
        #       0xE2809D      7957             8280
        #       0xE38DBB     12044              n/a
        #       0xE38DBC     12043              n/a
        #       0xE38DBD     12042              n/a
        #       0xE38DBE     12041              n/a
        #       0xEFBC9A     12101              n/a
        #
        #       Note, however, that these "Pro" CMap files are no longer
being
        #       maintained, and the UTF ones should be used instead.
        #
        # NOTE: The UniJIS-UTF32-H and UniJISX0213-UTF32-H CMap files each
        #       contain 13,609 mappings, but the following 65 mappings
differ,
        #       with the UniJISX0213-UTF32-H mappings in parentheses:
        #
        #       U+00A7  720 (106)
        #       U+00A8  647 (132)
        #       U+00B0  707 (155)
        #       U+00B1  694 (156)
        #       U+00B4  645 (127)
        #       U+00B6  778 (118)
        #       U+00D7  695 (186)
        #       U+00F7  696 (215)
        #       U+2010  662 (14)
        #       U+2012  114 (14)
        #       U+2032  708 (9356)
        #       U+2033  709 (9357)
        #       U+210F  12092 (15514)
        #       U+2135  12089 (15513)
        #       U+2194  12201 (15511)
        #       U+21D2  752 (15482)
        #       U+21D4  753 (15483)
        #       U+2200  754 (15484)
        #       U+2202  759 (15493)
        #       U+2203  755 (15485)
        #       U+2205  12184 (15477)
        #       U+2207  760 (15494)
        #       U+2208  741 (15464)
        #       U+220A  12091 (15900)
        #       U+220B  742 (15465)
        #       U+2211  7625 (15901)
        #       U+2212  693 (151)
        #       U+2213  12118 (15512)
        #       U+221A  765 (15499)
        #       U+221D  767 (15501)
        #       U+221E  703 (15459)
        #       U+221F  7629 (15881)
        #       U+2220  756 (15491)
        #       U+2227  749 (15480)
        #       U+2228  750 (15481)
        #       U+2229  748 (15471)
        #       U+222A  747 (15470)
        #       U+222B  769 (15503)
        #       U+222C  770 (15504)
        #       U+222D  8195 (15902)
        #       U+222E  7624 (15880)
        #       U+2234  704 (15460)
        #       U+2235  768 (15502)
        #       U+223D  766 (15500)
        #       U+2243  12120 (15506)
        #       U+2252  762 (15496)
        #       U+2260  698 (15456)
        #       U+2261  761 (15495)
        #       U+2266  701 (15457)
        #       U+2267  702 (15458)
        #       U+226A  763 (15497)
        #       U+226B  764 (15498)
        #       U+2272  12121 (15903)
        #       U+2273  12122 (15904)
        #       U+2282  745 (15468)
        #       U+2283  746 (15469)
        #       U+2286  743 (15466)
        #       U+2287  744 (15467)
        #       U+2295  12188 (15486)
        #       U+2296  12186 (15487)
        #       U+2297  12189 (15488)
        #       U+2298  12187 (15905)
        #       U+22A0  12185 (15907)
        #       U+22A5  757 (15492)
        #       U+22BF  7630 (15882)
        #
        #       Also, UniJIS-UTF32-V contains 290 vertical mapping
overrides,
        #       and UniJISX0213-UTF32-V contains 291. Among them, only nine
        #       vertical mapping overrides differ, as follows:
        #
        #       U+00B0  8269 (UniJIS-UTF32-V only)
        #       U+2010  7893 (UniJIS-UTF32-V only)
        #       U+2032  8273 (UniJIS-UTF32-V only)
        #       U+2033  8283 (UniJIS-UTF32-V only)
        #       U+337B  12044 (UniJISX0213-UTF32-V only)
        #       U+337C  12043 (UniJISX0213-UTF32-V only)
        #       U+337D  12042 (UniJISX0213-UTF32-V only)
        #       U+337E  12041 (UniJISX0213-UTF32-V only)
        #       U+FF1A  12101 (UniJISX0213-UTF32-V only)
        #
        #       When developing OpenType fonts, the UniJIS-UTF32-H and
        #       UniJIS-UTF32-V CMap files should be used with Adobe's
OpenType
        #       FDK, specifically MakeOTF, as arguments to the "-ch" and
"-cv"
        #       options, respectively, under the following conditions:
        #
        #       1) If the advertised /Supplement is 4 or less, meaning that
        #          the highest CID is 15443.
        #
        #       2) If the advertised /Supplement is 5, and if all of the
        #          UniJISX0213-UTF32-H- and UniJISX0213-UTF32-V-specific
        #          glyphs, as listed above, are not included.
        #
        #       Also, the UniJISX0213-UTF32-H and UniJISX0213-UTF32-V CMap
        #       files should be used if all 20,317 CIDs are included.

        Best Regards,
        Paulo Soares


> Document document = new Document(PageSize.A4.rotate(), 10,
> 10, 10, 10);
> try{
>     PdfWriter.getInstance(document, new
> FileOutputStream("Test.pdf"));
>     document.open();
>     BaseFont bf = BaseFont.createFont("HeiseiKakuGo-W5",
> "UniJIS-UCS2-H",false);
>     Font small_font = new Font(bf, 12);
>     document.add(new Paragraph((String)cemo, small_font));
>     }catch(DocumentException de) {
>          System.err.println(de.getMessage());
>     }catch(IOException ioe) {
>          System.err.println(ioe.getMessage());
>     }catch(Exception e){
>          System.err.println(e.getMessage());
>         document.close();     
>     }
> 
> Enviroment:Linux8.0, Struts1.0, Tomcat4.1
> 
> Thanks,
> YUMIKO.
> 
> 
> *************************************************
> HIYAMA Yumiko (MIKO)
>  [EMAIL PROTECTED]/// [EMAIL PROTECTED]
> -------------------------------------------------
>  HIROSHIMA PEACE MEMORIAL MUSEUM
>  http://www.pcf.city.hiroshima.jp/peacesite/
> *************************************************
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! BB is Broadband by Yahoo!
> http://bb.yahoo.co.jp/
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to