Package com.itextpdf.forms.fields
Class PdfFormFactory
java.lang.Object
com.itextpdf.forms.fields.PdfFormFactory
Default factory for form related instances creation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateButtonFormField(PdfWidgetAnnotation widget, PdfDocument document) Creates a button form field as a parent of aPdfWidgetAnnotation.createButtonFormField(PdfDictionary dictionary) Creates a button form field as a wrapper object around aPdfDictionary.createButtonFormField(PdfDocument document) Create a minimal, emptyPdfButtonFormField.createChoiceFormField(PdfWidgetAnnotation widget, PdfDocument document) Creates a choice form field as a parent of aPdfWidgetAnnotation.createChoiceFormField(PdfDictionary dictionary) Creates a choice form field as a wrapper object around aPdfDictionary.createChoiceFormField(PdfDocument document) Create a minimal, emptyPdfChoiceFormField.createFormAnnotation(PdfWidgetAnnotation widget, PdfDocument document) Creates a form field annotation as a wrapper of aPdfWidgetAnnotation.createFormAnnotation(PdfDictionary dictionary) Creates a form field annotation as a wrapper object around aPdfDictionary.createFormField(PdfWidgetAnnotation widget, PdfDocument document) Creates a form field as a parent of aPdfWidgetAnnotation.createFormField(PdfDictionary dictionary) Creates a form field as a wrapper object around aPdfDictionary.createFormField(PdfDocument document) Create a minimal, emptyPdfFormField.createSignatureFormField(PdfWidgetAnnotation widget, PdfDocument document) Creates a signature form field as a parent of aPdfWidgetAnnotation.createSignatureFormField(PdfDictionary dictionary) Creates a signature form field as a wrapper object around aPdfDictionary.createSignatureFormField(PdfDocument document) Create a minimal, emptyPdfSignatureFormField.createTextFormField(PdfWidgetAnnotation widget, PdfDocument document) Creates a text form field as a parent of aPdfWidgetAnnotation.createTextFormField(PdfDictionary dictionary) Creates a text form field as a wrapper object around aPdfDictionary.createTextFormField(PdfDocument document) Create a minimal, emptyPdfTextFormField.getAcroForm(PdfDocument document, boolean createIfNotExist) Retrieves AcroForm from the document.
-
Constructor Details
-
PdfFormFactory
public PdfFormFactory()CreatePdfFormFactoryinstance.
-
-
Method Details
-
createFormField
Create a minimal, emptyPdfFormField.- Parameters:
-
document- ThePdfDocumentinstance. - Returns:
-
created
PdfFormField
-
createFormField
Creates a form field as a wrapper object around aPdfDictionary. ThisPdfDictionarymust be an indirect object.- Parameters:
-
dictionary- the dictionary to be wrapped, must have an indirect reference. - Returns:
-
created
PdfFormField
-
createFormField
Creates a form field as a parent of aPdfWidgetAnnotation.- Parameters:
-
widget- The widget which will be a kid of thePdfFormField. -
document- ThePdfDocumentinstance. - Returns:
-
created
PdfFormField
-
createTextFormField
Create a minimal, emptyPdfTextFormField.- Parameters:
-
document- ThePdfDocumentinstance. - Returns:
-
created
PdfTextFormField
-
createTextFormField
Creates a text form field as a wrapper object around aPdfDictionary. ThisPdfDictionarymust be an indirect object.- Parameters:
-
dictionary- the dictionary to be wrapped, must have an indirect reference. - Returns:
-
created
PdfTextFormField
-
createTextFormField
Creates a text form field as a parent of aPdfWidgetAnnotation.- Parameters:
-
widget- The widget which will be a kid of thePdfTextFormField. -
document- ThePdfDocumentinstance. - Returns:
-
created
PdfTextFormField
-
createButtonFormField
Create a minimal, emptyPdfButtonFormField.- Parameters:
-
document- ThePdfDocumentinstance. - Returns:
-
created
PdfButtonFormField
-
createButtonFormField
Creates a button form field as a wrapper object around aPdfDictionary. ThisPdfDictionarymust be an indirect object.- Parameters:
-
dictionary- the dictionary to be wrapped, must have an indirect reference. - Returns:
-
created
PdfButtonFormField
-
createButtonFormField
Creates a button form field as a parent of aPdfWidgetAnnotation.- Parameters:
-
widget- The widget which will be a kid of thePdfButtonFormField. -
document- ThePdfDocumentinstance. - Returns:
-
created
PdfButtonFormField
-
createChoiceFormField
Create a minimal, emptyPdfChoiceFormField.- Parameters:
-
document- ThePdfDocumentinstance. - Returns:
-
created
PdfChoiceFormField
-
createChoiceFormField
Creates a choice form field as a wrapper object around aPdfDictionary. ThisPdfDictionarymust be an indirect object.- Parameters:
-
dictionary- the dictionary to be wrapped, must have an indirect reference. - Returns:
-
created
PdfChoiceFormField
-
createChoiceFormField
Creates a choice form field as a parent of aPdfWidgetAnnotation.- Parameters:
-
widget- The widget which will be a kid of thePdfChoiceFormField. -
document- ThePdfDocumentinstance. - Returns:
-
created
PdfChoiceFormField
-
createSignatureFormField
Create a minimal, emptyPdfSignatureFormField.- Parameters:
-
document- ThePdfDocumentinstance. - Returns:
-
created
PdfSignatureFormField
-
createSignatureFormField
Creates a signature form field as a wrapper object around aPdfDictionary. ThisPdfDictionarymust be an indirect object.- Parameters:
-
dictionary- the dictionary to be wrapped, must have an indirect reference. - Returns:
-
created
PdfSignatureFormField
-
createSignatureFormField
public PdfSignatureFormField createSignatureFormField(PdfWidgetAnnotation widget, PdfDocument document) Creates a signature form field as a parent of aPdfWidgetAnnotation.- Parameters:
-
widget- The widget which will be a kid of thePdfSignatureFormField. -
document- ThePdfDocumentinstance. - Returns:
-
created
PdfSignatureFormField
-
createFormAnnotation
Creates a form field annotation as a wrapper object around aPdfDictionary. ThisPdfDictionarymust be an indirect object.- Parameters:
-
dictionary- the dictionary to be wrapped, must have an indirect reference. - Returns:
-
created
PdfFormAnnotation
-
createFormAnnotation
Creates a form field annotation as a wrapper of aPdfWidgetAnnotation.- Parameters:
-
widget- The widget which will be a kid of thePdfFormField -
document- ThePdfDocumentinstance. - Returns:
-
created
PdfFormAnnotation
-
getAcroForm
Retrieves AcroForm from the document. If there is no AcroForm in the document Catalog and createIfNotExist flag is true then the AcroForm dictionary will be created and added to the document.- Parameters:
-
document- the document to retrieve thePdfAcroFormfrom -
createIfNotExist- whentrue, this method will create aPdfAcroFormif none exists for this document - Returns:
-
the
document's AcroForm, or a new one provided thatcreateIfNotExistparameter istrue, otherwisenull.
-