iText 5 is the previous major version of iText’s leading PDF SDK. iText 5 is EOL, and is no longer developed, although we still provide support and security fixes. Switch your project to iText 8, our latest version which supports the latest PDF standards and technologies.
Check related iText 8 content!
By default, the "required field" flag is not set when creating a form field. As you indicate in your question, you can use the
setFieldProperty() method to set this flag:
formFields.setFieldProperty(field, "setfflags", PdfFormField.FF_REQUIRED, null);
Based on your question, I assume that you have an existing PDF where you have fields for which this flag is already set. You can removed this flag (remove the bit from the bit set), by changing
formFields.setFieldProperty(field, "clrfflags", PdfFormField.FF_REQUIRED, null);
In this context
clr stands for clear and
fflags stands for field flags (not to be confused with
clrflags which will clear flags in the widget annotation).