iText 7 7.1.8 API
|
This class represents the static form technology AcroForm on a PDF file. More...
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 | AddFieldAppearanceToPage (PdfFormField field, PdfPage page) |
This method merges field with its annotation and place it on the given page. More... |
|
virtual IDictionary< String, PdfFormField > | GetFormFields () |
Gets the form field s as a System.Collections.IDictionary |
|
virtual ICollection< PdfFormField > | GetFieldsForFlattening () |
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. More... |
|
virtual PdfDocument | GetPdfDocument () |
Gets the iText.Kernel.Pdf.PdfDocument this PdfAcroForm belongs to. More... |
|
virtual iText.Forms.PdfAcroForm | SetNeedAppearances (bool needAppearances) |
Sets the More... |
|
virtual PdfBoolean | GetNeedAppearances () |
Gets the More... |
|
virtual iText.Forms.PdfAcroForm | SetSignatureFlags (int sigFlags) |
Sets the More... |
|
virtual iText.Forms.PdfAcroForm | SetSignatureFlag (int sigFlag) |
Changes the More... |
|
virtual int | GetSignatureFlags () |
Gets the More... |
|
virtual iText.Forms.PdfAcroForm | SetCalculationOrder (PdfArray calculationOrder) |
Sets the More... |
|
virtual PdfArray | GetCalculationOrder () |
Gets the More... |
|
virtual iText.Forms.PdfAcroForm | SetDefaultResources (PdfDictionary defaultResources) |
Sets the More... |
|
virtual PdfDictionary | GetDefaultResources () |
Gets the More... |
|
virtual iText.Forms.PdfAcroForm | SetDefaultAppearance (String appearance) |
Sets the More... |
|
virtual PdfString | GetDefaultAppearance () |
Gets the More... |
|
virtual iText.Forms.PdfAcroForm | SetDefaultJustification (int justification) |
Sets the More... |
|
virtual PdfNumber | GetDefaultJustification () |
Gets the More... |
|
virtual iText.Forms.PdfAcroForm | SetXFAResource (PdfStream xfaResource) |
Sets the More... |
|
virtual iText.Forms.PdfAcroForm | SetXFAResource (PdfArray xfaResource) |
Sets the More... |
|
virtual PdfObject | GetXFAResource () |
Gets the 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. If no fields have been explicitly included via PartialFormFlattening(System.String) , then all fields are flattened. Otherwise only the included fields are flattened. 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. Does not perform a flattening operation in itself. 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 . This new field is not added to the document. 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 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) |
virtual void | Release () |
Releases underlying pdf object and other pdf entities used by wrapper. More... |
|
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 iText.Kernel.Pdf.PdfObjectWrapper< T > | SetModified () |
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 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... |
|
This class represents the static form technology AcroForm on a PDF file.
|
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.
field | the iText.Forms.Fields.PdfFormField to be added to the form |
|
inlinevirtual |
This method adds the field to a specific page.
field | the iText.Forms.Fields.PdfFormField to be added to the form |
page | the iText.Kernel.Pdf.PdfPage on which to add the field |
|
inlinevirtual |
This method merges field with its annotation and place it on the given page.
This method merges field with its annotation and place it on the given page. This method won't work if the field has no or more than one widget annotations.
field | the iText.Forms.Fields.PdfFormField to be added to the form |
page | the iText.Kernel.Pdf.PdfPage on which to add the field |
|
inlinevirtual |
Creates an in-memory copy of a iText.Forms.Fields.PdfFormField . This new field is not added to the document.
name | the name of the form field to be copied |
|
inlinevirtual |
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.
|
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.
document | the document to retrieve the PdfAcroForm from |
createIfNotExist | when
true
|
|
inlinevirtual |
Gets the
CO
array property on the AcroForm.
Gets the
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")
|
inlinevirtual |
Gets the
DA
String property on the AcroForm.
Gets the
String property on the AcroForm.
This method returns the default (fallback value) for the
attribute of variable text form field s.
|
inlinevirtual |
Gets the
Q
integer property on the AcroForm.
Gets the
integer property on the AcroForm.
This method gets the default (fallback value) for the
attribute of variable text form field s.
|
inlinevirtual |
Gets the
DR
dictionary property on the AcroForm.
Gets the
dictionary property on the AcroForm.
DRis 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")
|
inlinevirtual |
Gets a form field by its name.
fieldName | the name of the form field to retrieve |
|
inlinevirtual |
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.
|
inlinevirtual |
Gets the form field s as a System.Collections.IDictionary
|
inlinevirtual |
Gets the
NeedAppearances
boolean property on the AcroForm.
Gets the
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")
|
inlinevirtual |
Gets the iText.Kernel.Pdf.PdfDocument this PdfAcroForm belongs to.
|
inlinevirtual |
Gets the
SigFlags
integer property on the AcroForm.
Gets the
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")
|
inlinevirtual |
Gets the iText.Forms.Xfa.XfaForm atribute.
|
inlinevirtual |
Gets the
XFA
property on the AcroForm.
|
inlinevirtual |
Determines whether the AcroForm contains XFA data.
|
inlinevirtual |
Gets the attribute generateAppearance, which tells FlattenFields() to generate an appearance Stream for all form field s that don't have one.
|
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.
Implements iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary >.
|
inlinevirtual |
Adds a form field , identified by name, to the list of fields to be flattened. Does not perform a flattening operation in itself.
fieldName | the name of the form field to be flattened |
|
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.
|
inlinevirtual |
Tries to remove the form field with the specified name from the document.
fieldName | the name of the form field to remove |
|
inlinevirtual |
Removes the XFA stream from the document.
|
inlinevirtual |
Changes the identifier of a form field
oldName | the current name of the field |
newName | the new name of the field. Must not be used currently. |
|
inlinevirtual |
Replaces the iText.Forms.Fields.PdfFormField of a certain name with another iText.Forms.Fields.PdfFormField
name | the name of the form field to be replaced |
field | the new iText.Forms.Fields.PdfFormField |
|
inlinevirtual |
Sets the
CO
array property on the AcroForm.
Sets the
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")
calculationOrder | an array of indirect references |
|
inlinevirtual |
Sets the
DA
String property on the AcroForm.
Sets the
String property on the AcroForm.
This method sets a default (fallback value) for the
attribute of variable text form field s.
appearance | a String containing a sequence of valid PDF syntax |
|
inlinevirtual |
Sets the
Q
integer property on the AcroForm.
Sets the
integer property on the AcroForm.
This method sets a default (fallback value) for the
attribute of variable text form field s.
justification | an integer representing a justification value |
|
inlinevirtual |
Sets the
DR
dictionary property on the AcroForm.
Sets the
dictionary property on the AcroForm.
DRis 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")
defaultResources | a resource dictionary |
|
inlinevirtual |
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.
generateAppearance | a boolean |
|
inlinevirtual |
Sets the
NeedAppearances
boolean property on the AcroForm.
Sets the
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")
needAppearances | a boolean. Default value is
false
|
|
inlinevirtual |
Changes the
SigFlags
integer property on the AcroForm.
Changes the
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")
sigFlag | an integer. Use SIGNATURE_EXIST and/or APPEND_ONLYUse bitwise OR operator to combine these values. Default is
0
|
|
inlinevirtual |
Sets the
SigFlags
integer property on the AcroForm.
Sets the
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")
sigFlags | an integer. Use SIGNATURE_EXIST and/or APPEND_ONLYUse bitwise OR operator to combine these values. Default value is
0
|
|
inlinevirtual |
Sets the
XFA
property on the AcroForm.
Sets the
property on the AcroForm.
can either be a iText.Kernel.Pdf.PdfStream or a iText.Kernel.Pdf.PdfArrayIts contents must be valid XFA.
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") |
|
inlinevirtual |
Sets the
XFA
property on the AcroForm.
Sets the
property on the AcroForm.
can either be a iText.Kernel.Pdf.PdfStream or a iText.Kernel.Pdf.PdfArrayIts contents must be valid XFA.
xfaResource | a stream containing the XDP |
|
static |
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")
|
static |
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")