  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | IDENTITY_H : UnsupportedEncodingException | IDENTITY_H : UnsupportedEncodingException 2007-11-15 - By Paulo Soares
Back IDENTITY_H only works with TrueType fonts. You'll need something like this:
DefaultFontMapper mapper = new DefaultFontMapper(); mapper.insertDirectory("c:\\windows\\fonts"); DefaultFontMapper.BaseFontParameters pp = mapper.getBaseFontParameters("Arial Unicode MS"); if (pp!=null) { pp.encoding = BaseFont.IDENTITY_H; }
Paulo
> -- --Original Message-- -- > From: itext-questions-bounces@(protected) > [mailto:itext-questions-bounces@(protected)] On > Behalf Of Guillaume Ange > Sent: Thursday, November 15, 2007 8:52 AM > To: itext-questions@(protected) > Subject: [iText-questions] IDENTITY_H : UnsupportedEncodingException > > Hello, > Here is a problem that I exposed to Bruno, he told me to post here. > I try to send a pdfGraphics2D to the paint method of an AWT component. > Everything works fine except that the text does not appear in > PDF for characters outside BaseFont.CP1252 subset. > It is a problem of encoding, the FontMapper, in awtToPdf > always use CP1252 as subset. > I've tried to use the IDENTITY_H subset, as I think it will > solve my problem, but I got this exception : > java.io.UnsupportedEncodingException: Identity-H > at java.lang.StringCoding.encode(Unknown Source) > at java.lang.String.getBytes(Unknown Source) > at > com.lowagie.text.pdf.PdfEncodings.convertToBytes(PdfEncodings. > java :195) > at com.lowagie.text.pdf.Type1Font.<init>(Type1Font.java:280) > at com.lowagie.text.pdf.BaseFont.createFont(BaseFont.java:513) > at com.lowagie.text.pdf.BaseFont.createFont(BaseFont.java:438) > at com.lowagie.text.pdf.BaseFont.createFont(BaseFont.java:385) > Is it a bug ? > Am I in the wrong way ? > Thanks for your help. > >
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.
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ __ ____ ____ ____ ____ ____ ____ ____ ____ ____ iText-questions mailing list iText-questions@(protected) https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
|
|
 |