intarsys PDF library API

de.intarsys.pdf.pd
Class PDAcroFormNode

java.lang.Object
  extended by de.intarsys.pdf.cos.COSBasedObject
      extended by de.intarsys.pdf.pd.PDObject
          extended by de.intarsys.pdf.pd.PDAcroFormNode
All Implemented Interfaces:
ICOSObjectListener, IAttributeSupport
Direct Known Subclasses:
PDAcroForm, PDAcroFormField

public abstract class PDAcroFormNode
extends PDObject

Abstract superclass to factor out commons between AcroForm and AcroForm field.


Nested Class Summary
static class PDAcroFormNode.MetaClass
          The meta class implementation
 
Field Summary
static COSName DK_DA
          The name for the DefaultAppereance entry.
static COSName DK_DR
          The name for the default resources.
static COSName DK_Encoding
          The name for the Encoding.
static COSName DK_Font
          The name for the fonts.
static COSName DK_Q
          The name for the Quadding entry.
static PDAcroFormNode.MetaClass META
          The meta class instance
 
Fields inherited from class de.intarsys.pdf.pd.PDObject
DK_Subtype, DK_Type
 
Method Summary
abstract  void addField(PDAcroFormField field)
          Insert a PDAcroFormField in the receiver node.
static String canonicalize(String name)
          Create a canonical form of the field name.
 List collectLeafFields()
          The list of all final nodes (fields) within this node.
abstract  PDAcroForm getAcroForm()
          The PDAcroForm for this node.
 PDAnnotation getAnnotation(int index)
          Get an annotation from the tree beyond this identified by index.
 List getAnnotations()
          A list of all annotations in the tree beyond this.
 CSContent getDefaultAppearanceContent()
          The CSContent fragment defining the default appearance to be used for variable text fields.
 PDFont getDefaultAppearanceFont()
          The font object defined by the default appearance.
 float[] getDefaultAppearanceFontColor()
          The font color defined by the default appearance.
 COSName getDefaultAppearanceFontName()
          The font name used by the default appearance to select a font from the resources.
 float getDefaultAppearanceFontSize()
          The font size defined by the default appearance,
 PDAcroFormField getField(String path)
          The sub-node identified by path.
 PDAcroFormField getField(String name, boolean canonicalName)
          The sub-node identified by path.
 int getQuadding()
          The justification of variable text within the field.
 void invalidateCaches()
          Invalidate all local caches as the base object may have changed.
abstract  boolean removeField(PDAcroFormField field)
          Remove a PDAcroFormField from the receiver.
 void setDefaultAppearanceContent(CSContent pContent)
          Set the content stream fragment to be used as the default appearance with variable text fields.
 void setDefaultAppearanceFont(PDFont font)
          Set the font to be used as the default font in variable text fields.
 void setDefaultAppearanceFontColor(float[] color)
          Set the font color to be used as the default font color in variable text fields.
 void setDefaultAppearanceFontSize(float size)
          Set the font size to be used as the default font size in variable text fields.
 void setQuadding(int quadding)
          Set the justification of variable text within the field.
 
Methods inherited from class de.intarsys.pdf.pd.PDObject
cosGetFieldDescendant, cosGetFieldInheritable, cosGetFieldInherited, cosGetSubtype, cosGetType, cosRemoveFieldInheritable, cosSetFieldInheritable, cosSetSubtype, cosSetType, getDoc, getGenericChildren, getGenericParent, setGenericParent, toString
 
Methods inherited from class de.intarsys.pdf.cos.COSBasedObject
changed, cosGetArray, cosGetDict, cosGetDoc, cosGetField, cosGetObject, cosGetStream, cosHasField, cosRemoveField, cosSetField, getAttribute, getFieldBoolean, getFieldDate, getFieldFixed, getFieldFixedArray, getFieldInt, getFieldMLString, getFieldString, removeAttribute, setAttribute, setFieldBoolean, setFieldFixed, setFieldInt, setFieldMLString, setFieldName, setFieldObject, setFieldString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DK_Encoding

public static final COSName DK_Encoding
The name for the Encoding.


DK_DR

public static final COSName DK_DR
The name for the default resources.


DK_Font

public static final COSName DK_Font
The name for the fonts.


DK_DA

public static final COSName DK_DA
The name for the DefaultAppereance entry.


DK_Q

public static final COSName DK_Q
The name for the Quadding entry.


META

public static final PDAcroFormNode.MetaClass META
The meta class instance

Method Detail

canonicalize

public static String canonicalize(String name)
Create a canonical form of the field name.

Parameters:
name - The field name to be converted.
Returns:
The canonical for of the field name.

addField

public abstract void addField(PDAcroFormField field)
Insert a PDAcroFormField in the receiver node.

Parameters:
field - The field to be inserted.

removeField

public abstract boolean removeField(PDAcroFormField field)
Remove a PDAcroFormField from the receiver.

Parameters:
field - The field to remove.
Returns:
true if field was removed.

getAcroForm

public abstract PDAcroForm getAcroForm()
The PDAcroForm for this node.

Returns:
The PDAcroForm for this node.

getAnnotation

public PDAnnotation getAnnotation(int index)
Get an annotation from the tree beyond this identified by index.

Returns:
An annotation from the tree beyond this identified by index.

getAnnotations

public List getAnnotations()
A list of all annotations in the tree beyond this.

Returns:
A list of all annotations in the tree beyond this.

getDefaultAppearanceContent

public CSContent getDefaultAppearanceContent()
The CSContent fragment defining the default appearance to be used for variable text fields.

Returns:
The CSContent fragment defining the default appearance to be used for variable text fields.

getDefaultAppearanceFont

public PDFont getDefaultAppearanceFont()
The font object defined by the default appearance.

Returns:
The font object defined by the default appearance.

getDefaultAppearanceFontColor

public float[] getDefaultAppearanceFontColor()
The font color defined by the default appearance.

Returns:
The font color defined by the default appearance.

getDefaultAppearanceFontName

public COSName getDefaultAppearanceFontName()
The font name used by the default appearance to select a font from the resources.

Returns:
The font name used by the default appearance to select a font from the resources.

getDefaultAppearanceFontSize

public float getDefaultAppearanceFontSize()
The font size defined by the default appearance,

Returns:
The font size defined by the default appearance,

getField

public PDAcroFormField getField(String path)
The sub-node identified by path. The path may be a navigation path containing multiple segments separated by a ".", each segment identifying a sub node in the node found so far.

The navigation starts at this and the first path segment is matched against the node's children. Example:
AcroForm | + Field1 | + Group1 | + FieldA | + FieldB When requesting the form itself, Field1 is addressed form.getField("Field1"); FieldA can be looked up form.getField("Group1.FieldA"); or group = form.getField("Group1"); group.getField("FieldA");

Parameters:
path - The navigation path to the field.
Returns:
The sub-node identified by path.

getField

public PDAcroFormField getField(String name,
                                boolean canonicalName)
The sub-node identified by path. The path may be a navigation path containing multiple segments separated by a ".", each segment identifying a sub node in the node found so far. If canonicalName is true, the name will be transformed to a canonical format before lookup.

Parameters:
name - The navigation path to the field.
canonicalName - Flag if lookup uses canonical form.
Returns:
The sub-node identified by path

collectLeafFields

public List collectLeafFields()
The list of all final nodes (fields) within this node.

Returns:
The list of all final nodes (fields) within this node.

getQuadding

public int getQuadding()
The justification of variable text within the field.

Returns:
An int representing the intended quadding for this field

invalidateCaches

public void invalidateCaches()
Description copied from class: COSBasedObject
Invalidate all local caches as the base object may have changed.

Overrides:
invalidateCaches in class COSBasedObject

setDefaultAppearanceContent

public void setDefaultAppearanceContent(CSContent pContent)
Set the content stream fragment to be used as the default appearance with variable text fields.

Parameters:
pContent - The new default appearance content.

setDefaultAppearanceFont

public void setDefaultAppearanceFont(PDFont font)
Set the font to be used as the default font in variable text fields.

Parameters:
font - The font to be used as the default font in variable text fields.

setDefaultAppearanceFontColor

public void setDefaultAppearanceFontColor(float[] color)
Set the font color to be used as the default font color in variable text fields.

Parameters:
color - The font color to be used as the default font color in variable text fields.

setDefaultAppearanceFontSize

public void setDefaultAppearanceFontSize(float size)
Set the font size to be used as the default font size in variable text fields.

Parameters:
size - The font size to be used as the default font size in variable text fields.

setQuadding

public void setQuadding(int quadding)
Set the justification of variable text within the field.

Parameters:
quadding - THe new quadding value

intarsys PDF library API

Copyright © 2006 intarsys consulting GmbH. All Rights Reserved.