Hi Paulo,
Thank you for such a quick response!  It turns out that adding

stamper.setFormFlattening(true);

did just the trick.  I don't know why I didn't think of this before,
except that I'm kind of new to iText. :-)

Thanks again,
Jim

On 5/23/06, Paulo Soares <[EMAIL PROTECTED]> wrote:
It might work if you only used AcroFields. Mixing it with PRAcroForm won't
work.

Paulo

----- Original Message -----
From: "Jim Bethancourt" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, May 23, 2006 6:40 PM
Subject: [iText-questions] Locking (setting ReadOnly) renamed AcroFields


Hello all,
I'm renaming a few fields with AcroFields.renameField, but I am unable
to set them as ReadOnly when I iterate over all of the AcroFields and
attempt to lock each one.  The fields that are not renamed can be
locked just fine, however.  I would appreciate any help you could
offer on how to lock the AcroFields that have been renamed.

The code below demonstrates how I'm renaming the AcroFields and then
locking them.

Thanks,
Jim

for (Iterator i = reader.getAcroForm().getFields().iterator(); i
.hasNext();) {
PRAcroForm.FieldInformation field = (PRAcroForm.FieldInformation) i
.next();
field.getInfo();

formFields.renameField(field.getName(), field.getName().concat(
stringToAppend));
}

//insert values into renamed AcroFields ...


AcroFields formFields = stamper.getAcroFields();
// Lock the fields
for (Iterator i = reader.getAcroForm().getFields().iterator(); i
.hasNext();) {
PRAcroForm.FieldInformation field = (PRAcroForm.FieldInformation) i
.next();
field.getInfo();
formFields.setFieldProperty(field.getName(), "setfflags",
PdfFormField.FF_READ_ONLY, null);
}


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=k&kid7521&bid$8729&dat1642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions



-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions



-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid7521&bid$8729&dat1642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to