Your table has two columns but you only fill one, you must fill the two. Also heck if document.add(p) works.
Paulo > -----Original Message----- > From: dummy.sn [mailto:[email protected]] > Sent: Monday, September 14, 2009 7:07 AM > To: [email protected] > Subject: [iText-questions] Japanese Character as table format for PDF > > > Hi All, > > I am trying to print a pdf with Japanese Characters as table > format. I am > using below mentioned code..... > > Document document = new Document(); > try { > OutputStream os = new > FileOutputStream('filename.pdf'); > PdfWriter.getInstance(document, os); > document.open(); > PdfPTable table; > PdfPCell cell; > Font font = new > Font(BaseFont.createFont("KozMinPro-Regular", > "UniJIS-UCS2-H", BaseFont.NOT_EMBEDDED),10, Font.UNDERLINE); > String text = "で日本語を使うためには"; > Paragraph p = new Paragraph(text, font); > p.setAlignment(Paragraph.ALIGN_CENTER); > float[] width = {1,4}; > table = new PdfPTable(width); > cell = new PdfPCell(p); > table.addCell(cell); > document.add(table); > document.close(); > } catch (Exception e) { > > } > > Using this one I am getting the generated PDF but not the > characters. Please > help me out to resolve this one. > > Any Kind of help will be appriciated. Aviso Legal: Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem. Disclaimer: This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
