DynamicPDF by ceTe Software

com.cete.dynamicpdf.forms
Class FormField

java.lang.Object
  extended by com.cete.dynamicpdf.Resource
      extended by com.cete.dynamicpdf.forms.FormField
Direct Known Subclasses:
ButtonField, ChoiceField, SignatureField, TextField

public class FormField
extends Resource

Represents a PDF form field.

Licensing:
Reading the values or properties of a field is a DynamicPDF Merger Standard Edition feature (for modifying field values see below). One of the following licenses is required for non-evaluation usage:

Modiying the values of the fields (i.e. form filling) is a Professional Edition Feature. One of the following licenses is required for non-evaluation usage:


Constructor Summary
FormField(java.lang.String name)
          Initializes a new instance of the FormField class.
FormField(java.lang.String name, FormFieldFlags flags, AnnotationReaderEvents actions)
          Initializes a new instance of the FormField class.
 
Method Summary
 void draw(DocumentWriter writer)
          Draws the form field to the given DocumentWriter object.
protected  void drawDictionary(DocumentWriter writer)
          Draws the form field's dictionary entries to the given DocumentWriter object.
 java.lang.String getAlternateName()
          Gets the alternate name of the form field.
protected  boolean getAnnotation()
          Gets a value indicating if the form field is an annotation.
 RgbColor getBackgroundColor()
          Gets the BackgroundColor of a form field.
 DeviceColor getBorderColor()
          Gets the BorderColor of a form field.
 BorderStyle getBorderStyle()
          Gets the BorderStyle.
 FormFieldList getChildFields()
          Gets a collection of child form fields.
 FormFieldFlags getFlags()
          Deprecated. as of v8.0.0 Instead use relevant flag name properties present on the PdfFormField class.
 Font getFont()
          Gets the Font of a form field.
 float getFontSize()
          Gets the FontSize for a form field.
 Form getForm()
          Gets the form containing this form field.
 java.lang.String getFullName()
          Gets the full name of the form field.
 java.lang.String getMappingName()
          Gets the mapping name of the form field.
 java.lang.String getName()
          Gets the name of the form field.
 FormFieldOutput getOutput()
          Gets output options for the field.
 FormField getParent()
          Gets the parent form field.
 int getRequiredPdfObjects()
          Gets the number of PDF objects required by the form field.
 ResourceType getResourceType()
          Gets the resource type.
 int getRotate()
          Gets the angle of a form field.
 DeviceColor getTextColor()
          Gets the TextColor of a form field.
 boolean getUseSubstituteFont()
          Gets whether to use SubstituteFont if the Font assigned is not found.
 java.lang.String getValue()
          Gets the value of the form field.
 boolean hasChildFields()
          Gets a value indicating if there are child form fields.
 boolean hasValue()
          Gets a value indicating if the form field has a value.
 boolean inheritsName()
          Gets a value indicating if the form field inherits its name.
 boolean inheritsValue()
          Gets a value indicating if the form field inherits its value.
 boolean isReadOnly()
          Gets a value indicating if the form field is read only.
 void setAlternateName(java.lang.String alternateName)
          Sets the alternate name of the form field.
protected  void setAnnotation(boolean isAnnotation)
          Sets a value indicating if the form field is an annotation.
 void setFont(Font font)
          Sets the Font for a form field.
 void setFontSize(float fontSize)
          Sets the FontSize for a form field.
 void setMappingName(java.lang.String mappingName)
          Sets the mapping name of the form field.
 void setName(java.lang.String name)
          Sets the name of the form field.
 void setOutput(FormFieldOutput value)
          Sets output options for the field.
 void setReadOnly(boolean isReadOnly)
          Sets a value indicating if the form field is read only.
 void setUseSubstituteFont(boolean value)
          Sets whether to use SubstituteFont if the Font assigned is not found.
 void setValue(java.lang.String value)
          Sets the value of the form field.
 
Methods inherited from class com.cete.dynamicpdf.Resource
getUid, newUid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormField

public FormField(java.lang.String name)
Initializes a new instance of the FormField class.

Parameters:
name - Name of the form field.
See Also:
FormField

FormField

public FormField(java.lang.String name,
                 FormFieldFlags flags,
                 AnnotationReaderEvents actions)
Initializes a new instance of the FormField class.

Parameters:
name - Name of the form field.
flags - The flags for the form field.
actions - The AnnotationReaderEvents for the form field.
See Also:
FormField
Method Detail

getRequiredPdfObjects

public int getRequiredPdfObjects()
Gets the number of PDF objects required by the form field.

Overrides:
getRequiredPdfObjects in class Resource
Returns:
The number of PDF objects required by the form field.

setAnnotation

protected void setAnnotation(boolean isAnnotation)
Sets a value indicating if the form field is an annotation.

Parameters:
isAnnotation - A value indicating if the form field is an annotation.

getAnnotation

protected boolean getAnnotation()
Gets a value indicating if the form field is an annotation.

Returns:
A value indicating if the form field is an annotation.

hasValue

public boolean hasValue()
Gets a value indicating if the form field has a value.

Returns:
A value indicating if the form field has a value.

setValue

public void setValue(java.lang.String value)
Sets the value of the form field.

Parameters:
value - The value of the form field.

getValue

public java.lang.String getValue()
Gets the value of the form field.

Returns:
The value of the form field.

inheritsName

public boolean inheritsName()
Gets a value indicating if the form field inherits its name.

Returns:
A value indicating if the form field inherits its name.

inheritsValue

public boolean inheritsValue()
Gets a value indicating if the form field inherits its value.

Returns:
A value indicating if the form field inherits its value.

setReadOnly

public void setReadOnly(boolean isReadOnly)
Sets a value indicating if the form field is read only.

Parameters:
isReadOnly - A value indicating if the form field is read only.

isReadOnly

public boolean isReadOnly()
Gets a value indicating if the form field is read only.

Returns:
A value indicating if the form field is read only.

getChildFields

public FormFieldList getChildFields()
Gets a collection of child form fields.

Returns:
A collection of child form fields.

getFlags

public FormFieldFlags getFlags()
Deprecated. as of v8.0.0 Instead use relevant flag name properties present on the PdfFormField class.

Gets flag status of a form field.

Returns:
flag status of a form field.

hasChildFields

public boolean hasChildFields()
Gets a value indicating if there are child form fields.

Returns:
A value indicating if there are child form fields.

getFullName

public java.lang.String getFullName()
Gets the full name of the form field.

Returns:
The full name of the form field.

setName

public void setName(java.lang.String name)
Sets the name of the form field.

Parameters:
name - The name of the form field.

getName

public java.lang.String getName()
Gets the name of the form field.

Returns:
The name of the form field.

setAlternateName

public void setAlternateName(java.lang.String alternateName)
Sets the alternate name of the form field.

Parameters:
alternateName - The alternate name of the form field.

getAlternateName

public java.lang.String getAlternateName()
Gets the alternate name of the form field.

Returns:
The alternate name of the form field.

setMappingName

public void setMappingName(java.lang.String mappingName)
Sets the mapping name of the form field.

Parameters:
mappingName - The mapping name of the form field.

getMappingName

public java.lang.String getMappingName()
Gets the mapping name of the form field.

Returns:
The mapping name of the form field.

getParent

public FormField getParent()
Gets the parent form field.

Returns:
The parent form field.

getForm

public Form getForm()
Gets the form containing this form field.

Returns:
The form containing this form field.

getBorderStyle

public BorderStyle getBorderStyle()
Gets the BorderStyle.

Returns:
the BorderStyle.

getBorderColor

public DeviceColor getBorderColor()
Gets the BorderColor of a form field.

Returns:
the BackgroundColor of a form field.

getBackgroundColor

public RgbColor getBackgroundColor()
Gets the BackgroundColor of a form field.

Returns:
the BackgroundColor of a form field.

getTextColor

public DeviceColor getTextColor()
Gets the TextColor of a form field.

Returns:
the TextColor of a form field.

getRotate

public int getRotate()
Gets the angle of a form field.

Returns:
the angle of a form field.

getFont

public Font getFont()
Gets the Font of a form field.

Returns:
the Font of a form field.

setFont

public void setFont(Font font)
Sets the Font for a form field.

Parameters:
font - the Font of a form field.

getFontSize

public float getFontSize()
Gets the FontSize for a form field.

Returns:
the FontSize for a form field.

setFontSize

public void setFontSize(float fontSize)
Sets the FontSize for a form field.

Parameters:
fontSize - the FontSize for a form field.

getUseSubstituteFont

public boolean getUseSubstituteFont()
Gets whether to use SubstituteFont if the Font assigned is not found.


setUseSubstituteFont

public void setUseSubstituteFont(boolean value)
Sets whether to use SubstituteFont if the Font assigned is not found.


getOutput

public FormFieldOutput getOutput()
Gets output options for the field.

Returns:
The output options for the field.

setOutput

public void setOutput(FormFieldOutput value)
Sets output options for the field.

Parameters:
value - output options for the field.

getResourceType

public ResourceType getResourceType()
Gets the resource type.

Overrides:
getResourceType in class Resource
Returns:
the resource type.
See Also:
ResourceType

draw

public void draw(DocumentWriter writer)
Draws the form field to the given DocumentWriter object.

Specified by:
draw in class Resource
Parameters:
writer - DocumentWriter object to receive the form field's output.
See Also:
DocumentWriter

drawDictionary

protected void drawDictionary(DocumentWriter writer)
Draws the form field's dictionary entries to the given DocumentWriter object.

Parameters:
writer - DocumentWriter object to receive the output.
See Also:
DocumentWriter

DynamicPDF by ceTe Software

API Reference for DynamicPDF v10.04 for Java generated on September 25, 2019
© Copyright 2019, ceTe Software