Hi,
(B
(BAttached below is the code for printing the text with a given font and
(Bcolor.
(B
(BEnglish text is printed without any problems however the Japanese text is
(Bnot printed at all (text is blank) or printed as question marks (???)
(B
(BPlease let me know what am I missing?
(B
(BThanks and Regards,
(B
(BAshish
(B
(Bimport java.awt.Color;
(Bimport java.io.*;
(Bimport com.lowagie.text.*;
(Bimport com.lowagie.text.pdf.*;
(B
(Bpublic class TableAbsPos {
(B
(B public static void main(String[] args) {
(B
(B // step 1: creation of a document-object
(B Document document = new Document(PageSize.A4, 50, 50, 50, 50);
(B try {
(B // step 2: we create a writer that listens to the document
(B PdfWriter writer = PdfWriter.getInstance(document, new
(BFileOutputStream("TAP.pdf"));
(B // step 3: we open the document
(B document.open();
(B
(B // step 4: we add some content
(B Font font9 = FontFactory.getFont(FontFactory.TIMES_NEW_ROMAN,
(B9);
(B Font font14B = FontFactory.getFont("msgothic.ttc,1", 14,
(BFont.BOLD, new Color(255, 0, 0));
(B
(B String encodedText =
(B"\202P\202Q\202R\202S\202T\202U\201|\202V\202W\202X\202O\202P\202Q\201|\202`
(B\202`";
(B encodedText = new String(encodedText.getBytes("ISO8859_1"),
(B"Shift_JIS");
(B
(B System.out.println(encodedText); <-- The Japanese text
(Bprinted by
(Bthis is OK.
(B
(B PdfPTable table = new PdfPTable(1);
(B table.getDefaultCell().setBorder(0);
(B table.addCell(new Phrase("Cell 1", font14B)); <-- This english
(Btext is OK.
(B table.addCell(new Phrase(encodedText, font14B)); <-- This is
(Bnot printed.
(B table.setTotalWidth(300);
(B table.writeSelectedRows(0, -1, 100, 600,
(Bwriter.getDirectContent());
(B // step 5: we close the document
(B document.close();
(B }
(B catch (Exception de) {
(B de.printStackTrace();
(B }
(B }
(B}
(B
(B
(B
(B
(B-------------------------------------------------------
(BThis sf.net email is sponsored by:ThinkGeek
(BWelcome to geek heaven.
(Bhttp://thinkgeek.com/sf
(B_______________________________________________
(BiText-questions mailing list
([EMAIL PROTECTED]
(Bhttps://lists.sourceforge.net/lists/listinfo/itext-questions