org.pdfbox.pdmodel.interactive.form
Class PDVariableText

java.lang.Object
  extended byorg.pdfbox.pdmodel.interactive.form.PDField
      extended byorg.pdfbox.pdmodel.interactive.form.PDVariableText
All Implemented Interfaces:
COSObjectable
Direct Known Subclasses:
PDChoiceField, PDTextbox

public abstract class PDVariableText
extends PDField

A class for handling PDF fields that display text.

Version:
$Revision: 1.7 $
Author:
Ben Litchfield

Field Summary
static int FLAG_COMB
          A Ff flag.
static int FLAG_DO_NOT_SCROLL
          A Ff flag.
static int FLAG_DO_NOT_SPELL_CHECK
          A Ff flag.
static int FLAG_FILE_SELECT
          A Ff flag.
static int FLAG_MULTILINE
          A Ff flag.
static int FLAG_PASSWORD
          A Ff flag.
static int FLAG_RICH_TEXT
          A Ff flag.
static int QUADDING_CENTERED
          A Q value.
static int QUADDING_LEFT
          A Q value.
static int QUADDING_RIGHT
          A Q value.
 
Fields inherited from class org.pdfbox.pdmodel.interactive.form.PDField
FLAG_NO_EXPORT, FLAG_READ_ONLY, FLAG_REQUIRED
 
Constructor Summary
PDVariableText(PDAcroForm theAcroForm)
           
PDVariableText(PDAcroForm theAcroForm, COSDictionary field)
           
 
Method Summary
 boolean doNotScroll()
           
 boolean doNotSpellCheck()
           
protected  COSString getDefaultAppearance()
           
 int getQ()
          This will get the 'quadding' or justification of the text to be displayed. 0 - Left(default)
1 - Centered
2 - Right
Please see the QUADDING_CONSTANTS.
 String getValue()
          getValue gets the fields value to as a string.
 boolean isFileSelect()
           
 boolean isMultiline()
           
 boolean isPassword()
           
 boolean isRichText()
           
 void setComb(boolean comb)
          Set the comb bit.
 void setDoNotScroll(boolean doNotScroll)
          Set the doNotScroll bit.
 void setDoNotSpellCheck(boolean doNotSpellCheck)
          Set the doNotSpellCheck bit.
 void setFileSelect(boolean fileSelect)
          Set the file select bit.
 void setMultiline(boolean multiline)
          Set the multiline bit.
 void setPassword(boolean password)
          Set the password bit.
 void setQ(int q)
          This will set the quadding/justification of the text.
 void setRichText(boolean richText)
          Set the richText bit.
 void setValue(String value)
          setValue sets the fields value to a given string.
 boolean shouldComb()
           
 
Methods inherited from class org.pdfbox.pdmodel.interactive.form.PDField
findFieldType, findKid, getAcroForm, getActions, getCOSObject, getDictionary, getFieldFlags, getFieldType, getFullyQualifiedName, getKids, getParent, getPartialName, getWidget, importFDF, isNoExport, isReadonly, isRequired, setAcroForm, setActions, setFieldFlags, setKids, setNoExport, setParent, setPartialName, setReadonly, setRequired, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FLAG_MULTILINE

public static final int FLAG_MULTILINE
A Ff flag.

See Also:
Constant Field Values

FLAG_PASSWORD

public static final int FLAG_PASSWORD
A Ff flag.

See Also:
Constant Field Values

FLAG_FILE_SELECT

public static final int FLAG_FILE_SELECT
A Ff flag.

See Also:
Constant Field Values

FLAG_DO_NOT_SPELL_CHECK

public static final int FLAG_DO_NOT_SPELL_CHECK
A Ff flag.

See Also:
Constant Field Values

FLAG_DO_NOT_SCROLL

public static final int FLAG_DO_NOT_SCROLL
A Ff flag.

See Also:
Constant Field Values

FLAG_COMB

public static final int FLAG_COMB
A Ff flag.

See Also:
Constant Field Values

FLAG_RICH_TEXT

public static final int FLAG_RICH_TEXT
A Ff flag.

See Also:
Constant Field Values

QUADDING_LEFT

public static final int QUADDING_LEFT
A Q value.

See Also:
Constant Field Values

QUADDING_CENTERED

public static final int QUADDING_CENTERED
A Q value.

See Also:
Constant Field Values

QUADDING_RIGHT

public static final int QUADDING_RIGHT
A Q value.

See Also:
Constant Field Values
Constructor Detail

PDVariableText

public PDVariableText(PDAcroForm theAcroForm)
Parameters:
theAcroForm - The acroform.
See Also:
PDField.PDField(PDAcroForm,COSDictionary)

PDVariableText

public PDVariableText(PDAcroForm theAcroForm,
                      COSDictionary field)
Parameters:
theAcroForm - The acroForm for this field.
field - The field's dictionary.
See Also:
PDField.PDField(PDAcroForm,COSDictionary)
Method Detail

setValue

public void setValue(String value)
              throws IOException
Description copied from class: PDField
setValue sets the fields value to a given string.

Specified by:
setValue in class PDField
Parameters:
value - The new value for this text field.
Throws:
IOException - If there is an error calculating the appearance stream.
See Also:
PDField.setValue(java.lang.String)

getValue

public String getValue()
                throws IOException
getValue gets the fields value to as a string.

Specified by:
getValue in class PDField
Returns:
The string value of this field.
Throws:
IOException - If there is an error getting the value.

isMultiline

public boolean isMultiline()
Returns:
true if the field is multiline

setMultiline

public void setMultiline(boolean multiline)
Set the multiline bit.

Parameters:
multiline - The value for the multiline.

isPassword

public boolean isPassword()
Returns:
true if the field is a password field.

setPassword

public void setPassword(boolean password)
Set the password bit.

Parameters:
password - The value for the password.

isFileSelect

public boolean isFileSelect()
Returns:
true if the field is a file select field.

setFileSelect

public void setFileSelect(boolean fileSelect)
Set the file select bit.

Parameters:
fileSelect - The value for the fileSelect.

doNotSpellCheck

public boolean doNotSpellCheck()
Returns:
true if the field is not suppose to spell check.

setDoNotSpellCheck

public void setDoNotSpellCheck(boolean doNotSpellCheck)
Set the doNotSpellCheck bit.

Parameters:
doNotSpellCheck - The value for the doNotSpellCheck.

doNotScroll

public boolean doNotScroll()
Returns:
true if the field is not suppose to scroll.

setDoNotScroll

public void setDoNotScroll(boolean doNotScroll)
Set the doNotScroll bit.

Parameters:
doNotScroll - The value for the doNotScroll.

shouldComb

public boolean shouldComb()
Returns:
true if the field is not suppose to comb the text display.

setComb

public void setComb(boolean comb)
Set the comb bit.

Parameters:
comb - The value for the comb.

isRichText

public boolean isRichText()
Returns:
true if the field is a rich text field.

setRichText

public void setRichText(boolean richText)
Set the richText bit.

Parameters:
richText - The value for the richText.

getDefaultAppearance

protected COSString getDefaultAppearance()
Returns:
the DA element of the dictionary object

getQ

public int getQ()
This will get the 'quadding' or justification of the text to be displayed. 0 - Left(default)
1 - Centered
2 - Right
Please see the QUADDING_CONSTANTS.

Returns:
The justification of the text strings.

setQ

public void setQ(int q)
This will set the quadding/justification of the text. See QUADDING constants.

Parameters:
q - The new text justification.