Package com.itextpdf.forms.fields
Class PdfFormFactory
- java.lang.Object
-
- com.itextpdf.forms.fields.PdfFormFactory
-
public class PdfFormFactory extends java.lang.ObjectDefault factory for form related instances creation.
-
-
Constructor Summary
Constructors Constructor Description PdfFormFactory()CreatePdfFormFactoryinstance.
-
Method Summary
-
-
-
Constructor Detail
-
PdfFormFactory
public PdfFormFactory()
CreatePdfFormFactoryinstance.
-
-
Method Detail
-
createFormField
public PdfFormField createFormField(PdfDocument document)
Create a minimal, emptyPdfFormField.- Parameters:
document- ThePdfDocumentinstance.- Returns:
- created
PdfFormField
-
createFormField
public PdfFormField createFormField(PdfDictionary dictionary)
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
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- ThePdfDocumentinstance.- Returns:
- created
PdfFormField
-
createTextFormField
public PdfTextFormField createTextFormField(PdfDocument document)
Create a minimal, emptyPdfTextFormField.- Parameters:
document- ThePdfDocumentinstance.- Returns:
- created
PdfTextFormField
-
createTextFormField
public PdfTextFormField createTextFormField(PdfDictionary dictionary)
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
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- ThePdfDocumentinstance.- Returns:
- created
PdfTextFormField
-
createButtonFormField
public PdfButtonFormField createButtonFormField(PdfDocument document)
Create a minimal, emptyPdfButtonFormField.- Parameters:
document- ThePdfDocumentinstance.- Returns:
- created
PdfButtonFormField
-
createButtonFormField
public PdfButtonFormField createButtonFormField(PdfDictionary dictionary)
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
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- ThePdfDocumentinstance.- Returns:
- created
PdfButtonFormField
-
createChoiceFormField
public PdfChoiceFormField createChoiceFormField(PdfDocument document)
Create a minimal, emptyPdfChoiceFormField.- Parameters:
document- ThePdfDocumentinstance.- Returns:
- created
PdfChoiceFormField
-
createChoiceFormField
public PdfChoiceFormField createChoiceFormField(PdfDictionary dictionary)
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
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- ThePdfDocumentinstance.- Returns:
- created
PdfChoiceFormField
-
createSignatureFormField
public PdfSignatureFormField createSignatureFormField(PdfDocument document)
Create a minimal, emptyPdfSignatureFormField.- Parameters:
document- ThePdfDocumentinstance.- Returns:
- created
PdfSignatureFormField
-
createSignatureFormField
public PdfSignatureFormField createSignatureFormField(PdfDictionary dictionary)
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
public PdfFormAnnotation createFormAnnotation(PdfDictionary dictionary)
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
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 thePdfFormFielddocument- ThePdfDocumentinstance.- 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 thePdfAcroFormfromcreateIfNotExist- whentrue, this method will create aPdfAcroFormif none exists for this document- Returns:
- the
document's AcroForm, or a new one provided thatcreateIfNotExistparameter istrue, otherwisenull.
-
-