Package com.itextpdf.forms.fields
Class PdfFormFactory
- java.lang.Object
-
- com.itextpdf.forms.fields.PdfFormFactory
-
public class PdfFormFactory extends java.lang.Object
Default factory for form related instances creation.
-
-
Constructor Summary
Constructors Constructor Description PdfFormFactory()
CreatePdfFormFactory
instance.
-
Method Summary
-
-
-
Constructor Detail
-
PdfFormFactory
public PdfFormFactory()
CreatePdfFormFactory
instance.
-
-
Method Detail
-
createFormField
public PdfFormField createFormField(PdfDocument document)
Create a minimal, emptyPdfFormField
.- Parameters:
document
- ThePdfDocument
instance.- Returns:
- created
PdfFormField
-
createFormField
public PdfFormField createFormField(PdfDictionary dictionary)
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
public PdfFormField createFormField(PdfWidgetAnnotation widget, PdfDocument document)
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
public PdfTextFormField createTextFormField(PdfDocument document)
Create a minimal, emptyPdfTextFormField
.- Parameters:
document
- ThePdfDocument
instance.- Returns:
- created
PdfTextFormField
-
createTextFormField
public PdfTextFormField createTextFormField(PdfDictionary dictionary)
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
public PdfTextFormField createTextFormField(PdfWidgetAnnotation widget, PdfDocument document)
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
public PdfButtonFormField createButtonFormField(PdfDocument document)
Create a minimal, emptyPdfButtonFormField
.- Parameters:
document
- ThePdfDocument
instance.- Returns:
- created
PdfButtonFormField
-
createButtonFormField
public PdfButtonFormField createButtonFormField(PdfDictionary dictionary)
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
public PdfButtonFormField createButtonFormField(PdfWidgetAnnotation widget, PdfDocument document)
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
public PdfChoiceFormField createChoiceFormField(PdfDocument document)
Create a minimal, emptyPdfChoiceFormField
.- Parameters:
document
- ThePdfDocument
instance.- Returns:
- created
PdfChoiceFormField
-
createChoiceFormField
public PdfChoiceFormField createChoiceFormField(PdfDictionary dictionary)
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
public PdfChoiceFormField createChoiceFormField(PdfWidgetAnnotation widget, PdfDocument document)
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
public PdfSignatureFormField createSignatureFormField(PdfDocument document)
Create a minimal, emptyPdfSignatureFormField
.- Parameters:
document
- ThePdfDocument
instance.- Returns:
- created
PdfSignatureFormField
-
createSignatureFormField
public PdfSignatureFormField createSignatureFormField(PdfDictionary dictionary)
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
public PdfFormAnnotation createFormAnnotation(PdfDictionary dictionary)
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
public PdfFormAnnotation createFormAnnotation(PdfWidgetAnnotation widget, PdfDocument document)
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
public PdfAcroForm getAcroForm(PdfDocument document, boolean createIfNotExist)
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
fromcreateIfNotExist
- 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
.
-
-