Package com.itextpdf.forms.fields
Class PdfFormFactory
java.lang.Object
com.itextpdf.forms.fields.PdfFormFactory
Default factory for form related instances creation.
-
Constructor Summary
-
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()CreatePdfFormFactory
instance.
-
-
Method Details
-
createFormField
Create a minimal, emptyPdfFormField
.- Parameters:
-
document
- ThePdfDocument
instance. - Returns:
-
created
PdfFormField
-
createFormField
Creates a form field as a wrapper object around aPdfDictionary
. ThisPdfDictionary
must 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
- ThePdfDocument
instance. - Returns:
-
created
PdfFormField
-
createTextFormField
Create a minimal, emptyPdfTextFormField
.- Parameters:
-
document
- ThePdfDocument
instance. - Returns:
-
created
PdfTextFormField
-
createTextFormField
Creates a text form field as a wrapper object around aPdfDictionary
. ThisPdfDictionary
must 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
- ThePdfDocument
instance. - Returns:
-
created
PdfTextFormField
-
createButtonFormField
Create a minimal, emptyPdfButtonFormField
.- Parameters:
-
document
- ThePdfDocument
instance. - Returns:
-
created
PdfButtonFormField
-
createButtonFormField
Creates a button form field as a wrapper object around aPdfDictionary
. ThisPdfDictionary
must 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
- ThePdfDocument
instance. - Returns:
-
created
PdfButtonFormField
-
createChoiceFormField
Create a minimal, emptyPdfChoiceFormField
.- Parameters:
-
document
- ThePdfDocument
instance. - Returns:
-
created
PdfChoiceFormField
-
createChoiceFormField
Creates a choice form field as a wrapper object around aPdfDictionary
. ThisPdfDictionary
must 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
- ThePdfDocument
instance. - Returns:
-
created
PdfChoiceFormField
-
createSignatureFormField
Create a minimal, emptyPdfSignatureFormField
.- Parameters:
-
document
- ThePdfDocument
instance. - Returns:
-
created
PdfSignatureFormField
-
createSignatureFormField
Creates a signature form field as a wrapper object around aPdfDictionary
. ThisPdfDictionary
must 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
- ThePdfDocument
instance. - Returns:
-
created
PdfSignatureFormField
-
createFormAnnotation
Creates a form field annotation as a wrapper object around aPdfDictionary
. ThisPdfDictionary
must 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
- ThePdfDocument
instance. - 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 thePdfAcroForm
from -
createIfNotExist
- whentrue
, this method will create aPdfAcroForm
if none exists for this document - Returns:
-
the
document
's AcroForm, or a new one provided thatcreateIfNotExist
parameter istrue
, otherwisenull
.
-