> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Wahaj Khan
> Sent: Thursday, October 12, 2006 7:41 AM
> To: [email protected]
> Subject: [iText-questions] Setting Unicode text in Signature 
> appearance
> 
> Hi All,
> 
> I am trying to set Unicode text e.g. Chinese in the signature 
> appearance of
> a signature. When I do that I get boxes in the resultant 
> signed pdf. Looking
> at the examples and tutorials it seems that the only way to 
> show Unicode
> text is to set text as
> 
> String text1 = "This text has
> \u0634\u0627\u062f\u062c\u0645\u0647\u0648\u0631 123,456 
> \u0645\u0646";
>

I don't know any other way to do it. At some stage you'll have to have
the Chinese text in a String.
 
> This creates a problem where one has Unicode text 
> entered/generated at run
> time e.g. Signing reason is entered in Chinese and thus 
> making a \uCODE
> format is not possible (I am not sure how to generate the 
> \uCODE at run time
> but I would like to avoid doing that).
> 

Slow down and think. \uCODE is just for literals that are going to be
compiled. If you have text in a database or text file it will be in some
encoding like UTF-8 or UTF-16 or GB18030 or something else. There are
String constructors that will convert a byte array to an Unicode String.

> Also I believe I can use both java.awt.Font font = new
> java.awt.Font("arial", 0, 18) OR  BaseFont bf =
> BaseFont.createFont("c:\\winnt\\fonts\\arial.ttf", 
> BaseFont.IDENTITY_H,
> true);
>

You must use a BaseFont that has the characters you need. For example
Arial will do for Russian, Hebrew and Arabic but won't do for Chinese.
 
> Is there a way to set the actual Chinese text directly in the 
> signature
> appearance.
> 

Yes. Set the font and the text in PdfSignatureAppearance.

Paulo

> Regards,
> Wahaj


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.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to