You have an encoding problem with your java files. It may be creating the java source with some encoding and compiling with another. This code should work regardless of the encoding:
PdfReader reader = new PdfReader("c:/demo_ru.pdf");
PdfStamper stamp = new PdfStamper(reader,
new FileOutputStream("c:/filled_demo_ru2.pdf"));
AcroFields form = stamp.getAcroFields();
String s = "\u0414\u0416";
byte b[] = s.getBytes("Cp1251");
s = new String(b, "Cp1252");
form.setField("ruvalue", s);
stamp.close();
Best Regards,
Paulo Soares
-----Original Message-----
From: Algirdas M. [SMTP:[EMAIL PROTECTED]
Sent: Tuesday, December 16, 2003 22:18
To: Paulo Soares
Cc: [EMAIL PROTECTED]
Subject: Re[6]: [iText-questions] (no subject)
Hello,
Tuesday, December 16, 2003, 8:06:23 PM, you wrote:
PS> There's no problem with it other than treating the font as Cp1251.
PS> In java everything is Unicode but you're using latin characters that
PS> translate to russian characters by the font special
PS> character positions. If you want it to work as-is (not recommended) do:
PS> String s = "some russian text";
PS> byte b[] = s.getBytes("Cp1251");
PS> String latin = new String(b, "Cp1252");
PS> form.setField("ruvalue", latin);
this way doesn't work for me too. Now result is the pdf file with
many question-marks instead of cyrilic characters.
And how you recommend to put russian text to TextBox fields?
Thank you.
--
Best regards,
Algirdas mailto:[EMAIL PROTECTED]
