Package com.ironsoftware.ironpdf.form
Class FormManager
- java.lang.Object
-
- com.ironsoftware.ironpdf.form.FormManager
-
public class FormManager extends Object
Class used to read and write data to AcroForms in aPdfDocument.
-
-
Constructor Summary
Constructors Constructor Description FormManager(InternalPdfDocument internalPdfDocument)Please get FormManager byPdfDocument.getForm()instead.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidflatten()Flattens a document (make all form fields non-editable).voidflatten(PageSelection pageSelection)Flattens a document (make all form fields non-editable).FormFieldsSetgetFields()Get a collection of the user-editable form fields within a PDF documentStringrenameField(String currentFieldName, String newFieldName)Rename aFormFieldvoidsetFieldReadOnly(String fieldName, boolean value)Set the is read only value of aFormFieldvoidsetFieldValue(String fieldName, String value)Set the string value of aFormFieldvoidsetTextFieldFont(String textFieldName, FontTypes font, int fontSize)Set the font of aTextField
-
-
-
Constructor Detail
-
FormManager
public FormManager(InternalPdfDocument internalPdfDocument)
Please get FormManager byPdfDocument.getForm()instead.- Parameters:
internalPdfDocument- the internal pdf document
-
-
Method Detail
-
flatten
public final void flatten()
Flattens a document (make all form fields non-editable).
-
flatten
public final void flatten(PageSelection pageSelection)
Flattens a document (make all form fields non-editable).- Parameters:
pageSelection- Selected page indexes. Default is all pages.
-
getFields
public FormFieldsSet getFields()
Get a collection of the user-editable form fields within a PDF document- Returns:
- FormFieldsSet
-
renameField
public String renameField(String currentFieldName, String newFieldName)
Rename aFormField- Parameters:
currentFieldName- Current fully qualified field namenewFieldName- New partial field name Please use a fully qualified field name for CurrentFieldName, and a partial field name for NewFieldName- Returns:
- New fully-qualified field name
-
setFieldValue
public void setFieldValue(String fieldName, String value)
Set the string value of aFormField- Parameters:
fieldName- Fully qualified field namevalue- New value
-
setFieldReadOnly
public void setFieldReadOnly(String fieldName, boolean value)
Set the is read only value of aFormField- Parameters:
fieldName- Fully qualified field namevalue- is read only
-
-