I am using partial form flattening. Sorry, should have included the code
snippet in the previous post. The field that I'm flattening looses the
pre-populated value and not the rest of the fields on the form. I need to
keep the pre-populated value in the flattened form field as well.
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("Text1", "Test Value");
form.setField("Text2", "Test Value");
form.setField("Text3", "Test Value");
form.setFieldProperty("Text2",
"setfflags",PdfFormField.FF_READ_ONLY, null);
stamp.setFormFlattening(true);
stamp.partialFormFlattening("Text2");
stamp.close();
}
catch(Exception de)
{
de.printStackTrace();
}
}
=====-----=====-----=====
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
[email protected]
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