Hi,

I have a PDF form in Chinese and have a requirement to prepopulate some of
the fields and set them as read-only. The PDF form uses font STSong-Light,
UniGB-UCS2-H. I have included the itext-asian.jar in the classpath for the
same. I am able to prepulate the field and set it as read-only. However, on
the resulting PDF, once the user clicks on any of the pre-populated
readonly field, he is no longer able to enter chinese characters in any of
the fields. The chinese character input works just fine, till the time the
pre-populated read only field is not clicked. The problem also does not
occur if the pre-populate field is left as editable. Only for read-only
fields the problem occurs. I have tried setting form.setGenerateAppearances
(false); but that does not help.

Also, is there a way to disable the clicking on a particular field. I am
just guessing that if I am able to disable the user from clicking on the
read-only field the problem won't occur.

Would really appreciate if someone could help with a solution for the above
problem. Please find my code snippet below:

public static void main(String[] args)
{
        try
        {
                FileInputStream pdf_fis = new FileInputStream("C:/Documents and
Settings/My Documents/China.pdf");
                FileOutputStream pdf_fos = new FileOutputStream("C:/Documents
and Settings/Filled_China_NEW.pdf");

                PdfReader reader = new PdfReader(pdf_fis);
                PdfStamper stamp = new PdfStamper(reader, pdf_fos);

                AcroFields form = stamp.getAcroFields();
                form.setGenerateAppearances(false);

                form.setField("Text2", "Test Value");
                form.setFieldProperty(fieldname, "setfflags",PdfFormField.
FF_READ_ONLY, null);

                stamp.close();
        }
        catch(Exception de)
        {
                de.printStackTrace();
        }
}


Thanks.

=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you




------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to