Vincent Guo wrote:
> Hello, I used iTextSharp to fill the textfeild, but I just found the
> textfeilds can be edited after the pdf file has been generated. so I
> just wonder if there is a way to stop the textfeilds from editting by
> others after it has been filled by iTextSharp.
in iText, you can either flatten the form:
stamper.setFormFlattening(true);
with stamper being a PdfStamper instance;
or you can set the field to Read-Only:
form.setFieldProperty(field,
"setfflags", PdfFormField.FF_READ_ONLY, null);
with form being an AcroFields instance.
It's more or less the same in iTextSharp.
Note that the form is "gone" when you flatten it. You end up with a PDF
that no longer has an interactive form; you can't retrieve the content
of the field anymore. That's a major difference with changing the field
to read-only.
--
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php