Hi,
I have a PDF containing various acrofields. Each acrofield contains default
text in Russian with some tokens embedded in it (i.e. <<<FirstName>>>).
Within my java code I read the acrofield default text into a string, attempt
to replace the tokens within the String with my own text, and then write it
back into the text of the acrofield.  
This does not work with Russian text at all, al I get is the English tokens
(not replaced) written back to the acrofield text.
 It works correctly if I use all English text in the acrofield default text
with the tokens replaced accordingly
Example of my code
// employ iText api to generate pdf document
 FileOutputStream generatedDocStream = new
FileOutputStream(generatedDocFullPathString);
 PdfReader reader = new PdfReader(templateFullPathString);
 PdfStamper stamp = new PdfStamper(reader, generatedDocStream);     
            AcroFields form = stamp.getAcroFields();
            Map allFields = form.getFields();
            Iterator itx = allFields.keySet().iterator();
            while (itx.hasNext()) {
                                String keyx = (String)itx.next();
                                   Iterator it = inputData.keySet().iterator();
                                     while (it.hasNext()) {
                                                String key = (String)it.next();
                                   String replacementString =
(String)inputData.get(key);
                                            String newString =
form.getField(keyx).replace(key, replacementString);
                               form.setField(keyx, newString);
                                       }
                }
Has anybody any ideas on how I could do this?
Cheers!

-- 
View this message in context: 
http://www.nabble.com/Problems-replacing-tokens-in-Foreign-text-extracted-from-an-acrofield-tp18462580p18462580.html
Sent from the iText - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to