iText 8.0.5 API
iText.Forms.PdfAcroForm Class Reference

This class represents the static form technology AcroForm on a PDF file. More...

Inheritance diagram for iText.Forms.PdfAcroForm:
iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary >

Public Member Functions

virtual void  AddField (PdfFormField field)
  This method adds the field to the last page in the document. More...
 
virtual void  AddField (PdfFormField field, PdfPage page)
  This method adds the field to a specific page. More...
 
virtual void  AddField (PdfFormField field, PdfPage page, bool throwExceptionOnError)
  This method adds the field to a specific page. More...
 
virtual void  AddFieldAppearanceToPage (PdfFormField field, PdfPage page)
  This method merges field with its annotation and places it on the given page. More...
 
virtual IDictionary< String, PdfFormField GetRootFormFields ()
  Gets root fields (i.e. direct children of Acroform dictionary). More...
 
virtual IDictionary< String, PdfFormField GetAllFormFields ()
  Gets all form field s as a System.Collections.IDictionary including fields kids. More...
 
virtual ICollection< AbstractPdfFormField GetAllFormFieldsAndAnnotations ()
  Gets all form field s as a Java.Util.Set including fields kids and nameless fields. More...
 
virtual ICollection< PdfFormField GetFieldsForFlattening ()
  Gets a collection of form field s, prepared for flattening using PartialFormFlattening(System.String) method. More...
 
virtual PdfDocument  GetPdfDocument ()
  Gets the iText.Kernel.Pdf.PdfDocument this PdfAcroForm belongs to. More...
 
virtual iText.Forms.PdfAcroForm  SetNeedAppearances (bool needAppearances)
  Sets the NeedAppearances boolean property on the AcroForm. More...
 
virtual PdfBoolean  GetNeedAppearances ()
  Gets the NeedAppearances boolean property on the AcroForm. More...
 
virtual iText.Forms.PdfAcroForm  SetSignatureFlags (int sigFlags)
  Sets the SigFlags integer property on the AcroForm. More...
 
virtual iText.Forms.PdfAcroForm  SetSignatureFlag (int sigFlag)
  Changes the SigFlags integer property on the AcroForm. More...
 
virtual int  GetSignatureFlags ()
  Gets the SigFlags integer property on the AcroForm. More...
 
virtual iText.Forms.PdfAcroForm  SetCalculationOrder (PdfArray calculationOrder)
  Sets the CO array property on the AcroForm. More...
 
virtual PdfArray  GetCalculationOrder ()
  Gets the CO array property on the AcroForm. More...
 
virtual iText.Forms.PdfAcroForm  SetDefaultResources (PdfDictionary defaultResources)
  Sets the DR dictionary property on the AcroForm. More...
 
virtual PdfDictionary  GetDefaultResources ()
  Gets the DR dictionary property on the AcroForm. More...
 
virtual iText.Forms.PdfAcroForm  SetDefaultAppearance (String appearance)
  Sets the DA String property on the AcroForm. More...
 
virtual PdfString  GetDefaultAppearance ()
  Gets the DA String property on the AcroForm. More...
 
virtual iText.Forms.PdfAcroForm  SetDefaultJustification (int justification)
  Sets the Q integer property on the AcroForm. More...
 
virtual PdfNumber  GetDefaultJustification ()
  Gets the Q integer property on the AcroForm. More...
 
virtual iText.Forms.PdfAcroForm  SetXFAResource (PdfStream xfaResource)
  Sets the XFA property on the AcroForm. More...
 
virtual iText.Forms.PdfAcroForm  SetXFAResource (PdfArray xfaResource)
  Sets the XFA property on the AcroForm. More...
 
virtual PdfObject  GetXFAResource ()
  Gets the XFA property on the AcroForm. More...
 
virtual PdfFormField  GetField (String fieldName)
  Gets a form field by its name. More...
 
virtual bool  IsGenerateAppearance ()
  Gets the attribute generateAppearance, which tells FlattenFields() to generate an appearance Stream for all form field s that don't have one. More...
 
virtual void  SetGenerateAppearance (bool generateAppearance)
  Sets the attribute generateAppearance, which tells FlattenFields() to generate an appearance Stream for all form field s that don't have one. More...
 
virtual void  FlattenFields ()
  Flattens interactive form field s in the document. More...
 
virtual bool  RemoveField (String fieldName)
  Tries to remove the form field with the specified name from the document. More...
 
virtual void  PartialFormFlattening (String fieldName)
  Adds a form field , identified by name, to the list of fields to be flattened. More...
 
virtual void  RenameField (String oldName, String newName)
  Changes the identifier of a form field. More...
 
virtual PdfFormField  CopyField (String name)
  Creates an in-memory copy of a iText.Forms.Fields.PdfFormField. More...
 
virtual void  ReplaceField (String name, PdfFormField field)
  Replaces the iText.Forms.Fields.PdfFormField of a certain name with another iText.Forms.Fields.PdfFormField. More...
 
virtual void  DisableRegenerationForAllFields ()
  Disables appearance stream regeneration for all the root fields in the Acroform, so all of its children in the hierarchy will also not be regenerated. More...
 
virtual void  EnableRegenerationForAllFields ()
  Enables appearance stream regeneration for all the fields in the Acroform and regenerates them. More...
 
virtual bool  HasXfaForm ()
  Determines whether the AcroForm contains XFA data. More...
 
virtual XfaForm  GetXfaForm ()
  Gets the iText.Forms.Xfa.XfaForm atribute. More...
 
virtual void  RemoveXfaForm ()
  Removes the XFA stream from the document. More...
 
virtual iText.Forms.PdfAcroForm  Put (PdfName key, PdfObject value)
  Put a key/value pair in the dictionary and overwrite previous value if it already exists. More...
 
virtual void  Release ()
  Releases underlying pdf object and other pdf entities used by wrapper. More...
 
override PdfObjectWrapper< PdfDictionary SetModified ()
 
- Public Member Functions inherited from iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary >
virtual T  GetPdfObject ()
 
virtual iText.Kernel.Pdf.PdfObjectWrapper< T >  MakeIndirect (PdfDocument document, PdfIndirectReference reference)
  Marks object behind wrapper to be saved as indirect. More...
 
virtual iText.Kernel.Pdf.PdfObjectWrapper< T >  MakeIndirect (PdfDocument document)
  Marks object behind wrapper to be saved as indirect. More...
 
virtual void  Flush ()
 
virtual bool  IsFlushed ()
 

Static Public Member Functions

static iText.Forms.PdfAcroForm  GetAcroForm (PdfDocument document, bool createIfNotExist)
  Retrieves AcroForm from the document. More...
 
static iText.Forms.PdfAcroForm  GetAcroForm (PdfDocument document, bool createIfNotExist, OnDuplicateFormFieldNameStrategy onDuplicateFieldNameStrategy)
  Retrieves AcroForm from the document. More...
 

Static Public Attributes

const int  SIGNATURE_EXIST = 1
  To be used with SetSignatureFlags(int). More...
 
const int  APPEND_ONLY = 2
  To be used with SetSignatureFlags(int). More...
 

Protected Member Functions

override bool  IsWrappedObjectMustBeIndirect ()
  Defines if the object behind this wrapper must be an indirect object in the resultant document. More...
 

Package Functions

virtual PdfArray  GetFields ()
  Gets all AcroForm fields in the document. More...
 
- Package Functions inherited from iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary >
  PdfObjectWrapper (T pdfObject)
 
virtual void  SetPdfObject (T pdfObject)
 
virtual void  SetForbidRelease ()
 
virtual void  UnsetForbidRelease ()
 
virtual void  EnsureUnderlyingObjectHasIndirectReference ()
 

Package Attributes

bool  generateAppearance = true
  Keeps track of whether or not appearances must be generated by the form fields themselves, or by the PDF viewer application. More...
 
IDictionary< String, PdfFormField fields = new LinkedDictionaryPdfFormField>()
  A map of field names and their associated form field objects. More...
 
PdfDocument  document
  The PdfDocument to which the PdfAcroForm belongs. More...
 

Additional Inherited Members

- Static Package Functions inherited from iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary >
static void  MarkObjectAsIndirect (PdfObject pdfObject)
 
static void  EnsureObjectIsAddedToDocument (PdfObject @object)
  Some wrappers use object's indirect reference to obtain the PdfDocument to which the object belongs to. More...
 

Detailed Description

This class represents the static form technology AcroForm on a PDF file.

Member Function Documentation

◆ AddField() [1/3]

virtual void iText.Forms.PdfAcroForm.AddField ( PdfFormField  field )
inlinevirtual

This method adds the field to the last page in the document.

This method adds the field to the last page in the document. If there's no pages, creates a new one.

Parameters
field the iText.Forms.Fields.PdfFormField to be added to the form

◆ AddField() [2/3]

virtual void iText.Forms.PdfAcroForm.AddField ( PdfFormField  field,
PdfPage  page 
)
inlinevirtual

This method adds the field to a specific page.

Parameters
field the iText.Forms.Fields.PdfFormField to be added to the form
page the iText.Kernel.Pdf.PdfPage on which to add the field

◆ AddField() [3/3]

virtual void iText.Forms.PdfAcroForm.AddField ( PdfFormField  field,
PdfPage  page,
bool  throwExceptionOnError 
)
inlinevirtual

This method adds the field to a specific page.

Parameters
field the iText.Forms.Fields.PdfFormField to be added to the form
page the iText.Kernel.Pdf.PdfPage on which to add the field
throwExceptionOnError true if the exception is expected to be thrown in case of error.

◆ AddFieldAppearanceToPage()

virtual void iText.Forms.PdfAcroForm.AddFieldAppearanceToPage ( PdfFormField  field,
PdfPage  page 
)
inlinevirtual

This method merges field with its annotation and places it on the given page.

This method merges field with its annotation and places it on the given page. This method also work if the field has more than one widget annotation, but doesn't work with no annotations.

Parameters
field the iText.Forms.Fields.PdfFormField to be added to the form
page the iText.Kernel.Pdf.PdfPage on which to add the field

◆ CopyField()

virtual PdfFormField iText.Forms.PdfAcroForm.CopyField ( String  name )
inlinevirtual

Creates an in-memory copy of a iText.Forms.Fields.PdfFormField.

Creates an in-memory copy of a iText.Forms.Fields.PdfFormField . This new field is not added to the document.

Parameters
name the name of the form field to be copied
Returns
a clone of the original iText.Forms.Fields.PdfFormField

◆ DisableRegenerationForAllFields()

virtual void iText.Forms.PdfAcroForm.DisableRegenerationForAllFields ( )
inlinevirtual

Disables appearance stream regeneration for all the root fields in the Acroform, so all of its children in the hierarchy will also not be regenerated.

◆ EnableRegenerationForAllFields()

virtual void iText.Forms.PdfAcroForm.EnableRegenerationForAllFields ( )
inlinevirtual

Enables appearance stream regeneration for all the fields in the Acroform and regenerates them.

◆ FlattenFields()

virtual void iText.Forms.PdfAcroForm.FlattenFields ( )
inlinevirtual

Flattens interactive form field s in the document.

Flattens interactive form field s in the document. If no fields have been explicitly included via PartialFormFlattening(System.String) , then all fields are flattened. Otherwise only the included fields are flattened.

◆ GetAcroForm() [1/2]

static iText.Forms.PdfAcroForm iText.Forms.PdfAcroForm.GetAcroForm ( PdfDocument  document,
bool  createIfNotExist 
)
inlinestatic

Retrieves AcroForm from the document.

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 the PdfAcroForm from
createIfNotExist when true, this method will create a PdfAcroForm if none exists for this document
Returns
the document 's AcroForm, or a new one provided that createIfNotExist parameter is true, otherwise null.

◆ GetAcroForm() [2/2]

static iText.Forms.PdfAcroForm iText.Forms.PdfAcroForm.GetAcroForm ( PdfDocument  document,
bool  createIfNotExist,
OnDuplicateFormFieldNameStrategy  onDuplicateFieldNameStrategy 
)
inlinestatic

Retrieves AcroForm from the document.

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 the PdfAcroForm from
createIfNotExist when true, this method will create a PdfAcroForm if none exists for this document
onDuplicateFieldNameStrategy the strategy to be used when a field with the same name already exists
Returns
the document 's AcroForm, or a new one provided that createIfNotExist parameter is true, otherwise null.

◆ GetAllFormFields()

virtual IDictionaryPdfFormField> iText.Forms.PdfAcroForm.GetAllFormFields ( )
inlinevirtual

Gets all form field s as a System.Collections.IDictionary including fields kids.

Returns
a map of field names and their associated form field objects

◆ GetAllFormFieldsAndAnnotations()

virtual ICollection<AbstractPdfFormField> iText.Forms.PdfAcroForm.GetAllFormFieldsAndAnnotations ( )
inlinevirtual

Gets all form field s as a Java.Util.Set including fields kids and nameless fields.

Returns
a set of form field objects.

◆ GetCalculationOrder()

virtual PdfArray iText.Forms.PdfAcroForm.GetCalculationOrder ( )
inlinevirtual

Gets the CO array property on the AcroForm.

Gets the CO array property on the AcroForm.

CO, Calculation Order, is an array of indirect references to field dictionaries with calculation actions, defining the calculation order in which their values will be recalculated when the value of any field changes (ISO 32000-1, section 12.7.2 "Interactive Form Dictionary")

Returns
an array of indirect references

◆ GetDefaultAppearance()

virtual PdfString iText.Forms.PdfAcroForm.GetDefaultAppearance ( )
inlinevirtual

Gets the DA String property on the AcroForm.

Gets the DA String property on the AcroForm.
This method returns the default (fallback value) for the DA attribute of variable text form field s.

Returns
the form-wide default appearance, as a String

◆ GetDefaultJustification()

virtual PdfNumber iText.Forms.PdfAcroForm.GetDefaultJustification ( )
inlinevirtual

Gets the Q integer property on the AcroForm.

Gets the Q integer property on the AcroForm.
This method gets the default (fallback value) for the Q attribute of variable text form field s.

Returns
an integer representing a justification value
See also
iText.Forms.Fields.PdfFormField.GetJustification()

◆ GetDefaultResources()

virtual PdfDictionary iText.Forms.PdfAcroForm.GetDefaultResources ( )
inlinevirtual

Gets the DR dictionary property on the AcroForm.

Gets the DR dictionary property on the AcroForm.

DR is a resource dictionary containing default resources (such as fonts, patterns, or colour spaces) that shall be used by form field appearance streams. At a minimum, this dictionary shall contain a Font entry specifying the resource name and font dictionary of the default font for displaying text. (ISO 32000-1, section 12.7.2 "Interactive Form Dictionary")

Returns
a resource dictionary

◆ GetField()

virtual PdfFormField iText.Forms.PdfAcroForm.GetField ( String  fieldName )
inlinevirtual

Gets a form field by its name.

Parameters
fieldName the name of the form field to retrieve
Returns
the form field , or null if it isn't present

◆ GetFields()

virtual PdfArray iText.Forms.PdfAcroForm.GetFields ( )
inlinepackagevirtual

Gets all AcroForm fields in the document.

Returns
a iText.Kernel.Pdf.PdfArray of field dictionaries

◆ GetFieldsForFlattening()

virtual ICollection<PdfFormField> iText.Forms.PdfAcroForm.GetFieldsForFlattening ( )
inlinevirtual

Gets a collection of form field s, prepared for flattening using PartialFormFlattening(System.String) method.

Gets a collection of form field s, prepared for flattening using PartialFormFlattening(System.String) method. If returned collection is empty, all form fields will be flattened on flattenFields call.

Returns
a collection of form field s for flattening

◆ GetNeedAppearances()

virtual PdfBoolean iText.Forms.PdfAcroForm.GetNeedAppearances ( )
inlinevirtual

Gets the NeedAppearances boolean property on the AcroForm.

Gets the NeedAppearances boolean property on the AcroForm. NeedAppearances has been deprecated in PDF 2.0.

NeedAppearances is a flag specifying whether to construct appearance streams and appearance dictionaries for all widget annotations in the document. (ISO 32000-1, section 12.7.2 "Interactive Form Dictionary")

Returns
the NeedAppearances property as a iText.Kernel.Pdf.PdfBoolean . Default value is false

◆ GetPdfDocument()

virtual PdfDocument iText.Forms.PdfAcroForm.GetPdfDocument ( )
inlinevirtual

Gets the iText.Kernel.Pdf.PdfDocument this PdfAcroForm belongs to.

Returns
the document of this form

◆ GetRootFormFields()

virtual IDictionaryPdfFormField> iText.Forms.PdfAcroForm.GetRootFormFields ( )
inlinevirtual

Gets root fields (i.e. direct children of Acroform dictionary).

Returns
a map of field names and their associated form field objects

◆ GetSignatureFlags()

virtual int iText.Forms.PdfAcroForm.GetSignatureFlags ( )
inlinevirtual

Gets the SigFlags integer property on the AcroForm.

Gets the SigFlags integer property on the AcroForm.

SigFlags is a set of flags specifying various document-level characteristics related to signature fields (ISO 32000-1, section 12.7.2 "Interactive Form Dictionary")

Returns
current value for SigFlags.

◆ GetXfaForm()

virtual XfaForm iText.Forms.PdfAcroForm.GetXfaForm ( )
inlinevirtual

Gets the iText.Forms.Xfa.XfaForm atribute.

Returns
the XFA form object

◆ GetXFAResource()

virtual PdfObject iText.Forms.PdfAcroForm.GetXFAResource ( )
inlinevirtual

Gets the XFA property on the AcroForm.

Returns
an object representing the entire XDP. It can either be a iText.Kernel.Pdf.PdfStream or a iText.Kernel.Pdf.PdfArray.

◆ HasXfaForm()

virtual bool iText.Forms.PdfAcroForm.HasXfaForm ( )
inlinevirtual

Determines whether the AcroForm contains XFA data.

Returns
a boolean

◆ IsGenerateAppearance()

virtual bool iText.Forms.PdfAcroForm.IsGenerateAppearance ( )
inlinevirtual

Gets the attribute generateAppearance, which tells FlattenFields() to generate an appearance Stream for all form field s that don't have one.

Returns
bolean value indicating if the appearances need to be generated

◆ IsWrappedObjectMustBeIndirect()

override bool iText.Forms.PdfAcroForm.IsWrappedObjectMustBeIndirect ( )
inlineprotectedvirtual

Defines if the object behind this wrapper must be an indirect object in the resultant document.

Defines if the object behind this wrapper must be an indirect object in the resultant document.

If this method returns true it doesn't necessarily mean that object must be in the indirect state at any moment, but rather defines that when the object will be written to the document it will be transformed into indirect object if it's not indirect yet.

Return value of this method shouldn't depend on any logic, it should return always true or false.

Returns
true if in the resultant document the object behind the wrapper must be indirect, otherwise false.

Implements iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary >.

◆ PartialFormFlattening()

virtual void iText.Forms.PdfAcroForm.PartialFormFlattening ( String  fieldName )
inlinevirtual

Adds a form field , identified by name, to the list of fields to be flattened.

Adds a form field , identified by name, to the list of fields to be flattened. Does not perform a flattening operation in itself.

Parameters
fieldName the name of the form field to be flattened

◆ Put()

virtual iText.Forms.PdfAcroForm iText.Forms.PdfAcroForm.Put ( PdfName  key,
PdfObject  value 
)
inlinevirtual

Put a key/value pair in the dictionary and overwrite previous value if it already exists.

Parameters
key the key as pdf name
value the value as pdf object
Returns
this PdfAcroForm instance

◆ Release()

virtual void iText.Forms.PdfAcroForm.Release ( )
inlinevirtual

Releases underlying pdf object and other pdf entities used by wrapper.

Releases underlying pdf object and other pdf entities used by wrapper. This method should be called instead of direct call to iText.Kernel.Pdf.PdfObject.Release() if the wrapper is used.

◆ RemoveField()

virtual bool iText.Forms.PdfAcroForm.RemoveField ( String  fieldName )
inlinevirtual

Tries to remove the form field with the specified name from the document.

Parameters
fieldName the name of the form field to remove
Returns
a boolean representing whether or not the removal succeeded.

◆ RemoveXfaForm()

virtual void iText.Forms.PdfAcroForm.RemoveXfaForm ( )
inlinevirtual

Removes the XFA stream from the document.

◆ RenameField()

virtual void iText.Forms.PdfAcroForm.RenameField ( String  oldName,
String  newName 
)
inlinevirtual

Changes the identifier of a form field.

Parameters
oldName the current name of the field
newName the new name of the field. Must not be used currently.

◆ ReplaceField()

virtual void iText.Forms.PdfAcroForm.ReplaceField ( String  name,
PdfFormField  field 
)
inlinevirtual

Replaces the iText.Forms.Fields.PdfFormField of a certain name with another iText.Forms.Fields.PdfFormField.

Parameters
name the name of the form field to be replaced
field the new iText.Forms.Fields.PdfFormField

◆ SetCalculationOrder()

virtual iText.Forms.PdfAcroForm iText.Forms.PdfAcroForm.SetCalculationOrder ( PdfArray  calculationOrder )
inlinevirtual

Sets the CO array property on the AcroForm.

Sets the CO array property on the AcroForm.

CO, Calculation Order, is an array of indirect references to field dictionaries with calculation actions, defining the calculation order in which their values will be recalculated when the value of any field changes (ISO 32000-1, section 12.7.2 "Interactive Form Dictionary")

Parameters
calculationOrder an array of indirect references
Returns
current AcroForm

◆ SetDefaultAppearance()

virtual iText.Forms.PdfAcroForm iText.Forms.PdfAcroForm.SetDefaultAppearance ( String  appearance )
inlinevirtual

Sets the DA String property on the AcroForm.

Sets the DA String property on the AcroForm.
This method sets a default (fallback value) for the DA attribute of variable text form field s.

Parameters
appearance a String containing a sequence of valid PDF syntax
Returns
current AcroForm

◆ SetDefaultJustification()

virtual iText.Forms.PdfAcroForm iText.Forms.PdfAcroForm.SetDefaultJustification ( int  justification )
inlinevirtual

Sets the Q integer property on the AcroForm.

Sets the Q integer property on the AcroForm.
This method sets a default (fallback value) for the Q attribute of variable text form field s.

Parameters
justification an integer representing a justification value
Returns
current AcroForm
See also
iText.Forms.Fields.PdfFormField.SetJustification(iText.Layout.Properties.TextAlignment?)

◆ SetDefaultResources()

virtual iText.Forms.PdfAcroForm iText.Forms.PdfAcroForm.SetDefaultResources ( PdfDictionary  defaultResources )
inlinevirtual

Sets the DR dictionary property on the AcroForm.

Sets the DR dictionary property on the AcroForm.

DR is a resource dictionary containing default resources (such as fonts, patterns, or colour spaces) that shall be used by form field appearance streams. At a minimum, this dictionary shall contain a Font entry specifying the resource name and font dictionary of the default font for displaying text. (ISO 32000-1, section 12.7.2 "Interactive Form Dictionary")

Parameters
defaultResources a resource dictionary
Returns
current AcroForm

◆ SetGenerateAppearance()

virtual void iText.Forms.PdfAcroForm.SetGenerateAppearance ( bool  generateAppearance )
inlinevirtual

Sets the attribute generateAppearance, which tells FlattenFields() to generate an appearance Stream for all form field s that don't have one.

Sets the attribute generateAppearance, which tells FlattenFields() to generate an appearance Stream for all form field s that don't have one.

Not generating appearances will speed up form flattening but the results can be unexpected in Acrobat. Don't use it unless your environment is well controlled. The default is true.

If generateAppearance is set to true, then NeedAppearances is set to false. This does not apply vice versa.

Note, this method does not change default behaviour of iText.Forms.Fields.PdfFormField.SetValue(System.String) method.

Parameters
generateAppearance a boolean

◆ SetNeedAppearances()

virtual iText.Forms.PdfAcroForm iText.Forms.PdfAcroForm.SetNeedAppearances ( bool  needAppearances )
inlinevirtual

Sets the NeedAppearances boolean property on the AcroForm.

Sets the NeedAppearances boolean property on the AcroForm. NeedAppearances has been deprecated in PDF 2.0.

NeedAppearances is a flag specifying whether to construct appearance streams and appearance dictionaries for all widget annotations in the document. (ISO 32000-1, section 12.7.2 "Interactive Form Dictionary")

Parameters
needAppearances a boolean. Default value is false
Returns
current AcroForm.

◆ SetSignatureFlag()

virtual iText.Forms.PdfAcroForm iText.Forms.PdfAcroForm.SetSignatureFlag ( int  sigFlag )
inlinevirtual

Changes the SigFlags integer property on the AcroForm.

Changes the SigFlags integer property on the AcroForm. This method allows only to add flags, not to remove them.

SigFlags is a set of flags specifying various document-level characteristics related to signature fields. (ISO 32000-1, section 12.7.2 "Interactive Form Dictionary")

Parameters
sigFlag an integer. Use SIGNATURE_EXIST and/or APPEND_ONLY. Use bitwise OR operator to combine these values. Default is 0
Returns
current AcroForm.

◆ SetSignatureFlags()

virtual iText.Forms.PdfAcroForm iText.Forms.PdfAcroForm.SetSignatureFlags ( int  sigFlags )
inlinevirtual

Sets the SigFlags integer property on the AcroForm.

Sets the SigFlags integer property on the AcroForm.

SigFlags is a set of flags specifying various document-level characteristics related to signature fields. (ISO 32000-1, section 12.7.2 "Interactive Form Dictionary")

Parameters
sigFlags an integer. Use SIGNATURE_EXIST and/or APPEND_ONLY. Use bitwise OR operator to combine these values. Default value is 0
Returns
current AcroForm.

◆ SetXFAResource() [1/2]

virtual iText.Forms.PdfAcroForm iText.Forms.PdfAcroForm.SetXFAResource ( PdfArray  xfaResource )
inlinevirtual

Sets the XFA property on the AcroForm.

Sets the XFA property on the AcroForm.
XFA can either be a iText.Kernel.Pdf.PdfStream or a iText.Kernel.Pdf.PdfArray. Its contents must be valid XFA.

Parameters
xfaResource an array of text string and stream pairs representing the individual packets comprising the XML Data Package. (ISO 32000-1, section 12.7.2 "Interactive Form Dictionary")
Returns
current AcroForm

◆ SetXFAResource() [2/2]

virtual iText.Forms.PdfAcroForm iText.Forms.PdfAcroForm.SetXFAResource ( PdfStream  xfaResource )
inlinevirtual

Sets the XFA property on the AcroForm.

Sets the XFA property on the AcroForm.
XFA can either be a iText.Kernel.Pdf.PdfStream or a iText.Kernel.Pdf.PdfArray. Its contents must be valid XFA.

Parameters
xfaResource a stream containing the XDP
Returns
current AcroForm

Member Data Documentation

◆ APPEND_ONLY

const int iText.Forms.PdfAcroForm.APPEND_ONLY = 2
static

To be used with SetSignatureFlags(int).

To be used with SetSignatureFlags(int).

If set, the document contains signatures that may be invalidated if the file is saved (written) in a way that alters its previous contents, as opposed to an incremental update. Merely updating the file by appending new information to the end of the previous version is safe. Conforming readers may use this flag to inform a user requesting a full save that signatures will be invalidated and require explicit confirmation before continuing with the operation. (ISO 32000-1, section 12.7.2 "Interactive Form Dictionary")

◆ document

PdfDocument iText.Forms.PdfAcroForm.document
package

The PdfDocument to which the PdfAcroForm belongs.

◆ fields

IDictionaryPdfFormField> iText.Forms.PdfAcroForm.fields = new LinkedDictionaryPdfFormField>()
package

A map of field names and their associated form field objects.

◆ generateAppearance

bool iText.Forms.PdfAcroForm.generateAppearance = true
package

Keeps track of whether or not appearances must be generated by the form fields themselves, or by the PDF viewer application.

Keeps track of whether or not appearances must be generated by the form fields themselves, or by the PDF viewer application. Default is true.

◆ SIGNATURE_EXIST

const int iText.Forms.PdfAcroForm.SIGNATURE_EXIST = 1
static

To be used with SetSignatureFlags(int).

To be used with SetSignatureFlags(int).

If set, the document contains at least one signature field. This flag allows a conforming reader to enable user interface items (such as menu items or pushbuttons) related to signature processing without having to scan the entire document for the presence of signature fields. (ISO 32000-1, section 12.7.2 "Interactive Form Dictionary")