DynamicPDF by ceTe Software

com.cete.dynamicpdf.pageelements
Class FormattedTextArea

java.lang.Object
  extended by com.cete.dynamicpdf.PageElement
      extended by com.cete.dynamicpdf.pageelements.TaggablePageElement
          extended by com.cete.dynamicpdf.pageelements.RotatingPageElement
              extended by com.cete.dynamicpdf.pageelements.FormattedTextArea
All Implemented Interfaces:
IArea, ICoordinate, com.cete.dynamicpdf.pageelements.ITextSettable

public class FormattedTextArea
extends RotatingPageElement
implements IArea, ICoordinate, com.cete.dynamicpdf.pageelements.ITextSettable

This class can be used to place Formatted formatted text onto an area of the page.

The FormattedTextArea class accepts the following Formatted tags and attributes. Some of the attributes are in addition to the attribute found in Formatted and are used for advanced paragraph and line properties. Please note that white space can be treated literally or ignored (standard behavior for Formatted).

These tags map directly into the FormattedTextAreaStyle class. This class is used internally to manage the state of the Formatted Text Area. The style property of the Formatted Text Area represents the initial state of the text.

<B ... - Bold Tag

Enclosed text is bold.

<Font ... - Font Tag

Attribute Values Description
Color Web Color Hex String. Color of the text.
Face A string value. The font family to use for the text. The 5 built-in font families ("Times" | "Helvetica" | "Courier" | "Symbol" | "ZapfDingbats") can be specified or additional ones can be added through the FormattedTextArea's FontFaces property.
Size An integer value. Specifies the Formatted font size for the text. This is mapped to a point size internally (0 = 6 points, 1 = 8 points, 2 = 10 points, 3 = 12 points, 4 = 14 points, 5 = 18 points, 6 = 24 points, 7 = 36 points).
PointSize A decimal value. The size in points of the text.

<I ... - Italics Tag

Enclosed text is italic.

<Line ... - Line Tag

Attribute Values Description
Leading A decimal value. The leading of the line.
LeadingType auto | atLeast | exactly Specifies how leading is calculated.

<P ... - Paragraph Tag

Attribute Values Description
Align left | right | center | justify Alignment of the paragraph's text.
AllowOrphanLines true | false Specifies if one orphaned line should be allowed to be left on a page, or if it should be grouped with at least one other line for text continuation.
Indent A decimal value. The first line indentation of the paragraph in points.
LeftIndent A decimal value. The left indentation of the paragraph in points.
PreserveWhiteSpace true | false Specifies if white space should be preserved.
RightIndent A decimal value. The right indentation of the paragraph in points.
SpacingAfter A decimal value. The spacing after the paragraph in points.
SpacingBefore A decimal value. The spacing before the paragraph in points.

<U ... - underline Tag

Enclosed text is underlined.

Licensing:
This class is a DynamicPDF Generator Professional Edition feature. One of the following licenses is required for non-evaluation usage:

View Example


Nested Class Summary
protected  class FormattedTextArea.Line
           
protected  class FormattedTextArea.LineList
           
 
Constructor Summary
FormattedTextArea(char[] text, float x, float y, float width, float height, FontFamily fontFamily, float fontSize, boolean preserveWhitespace)
          Initializes a new instance of the FormattedTextArea class.
FormattedTextArea(char[] text, float x, float y, float width, float height, FormattedTextAreaStyle style)
          Initializes a new instance of the FormattedTextArea class.
FormattedTextArea(java.lang.String text, float x, float y, float width, float height, FontFamily fontFamily, float fontSize, boolean preserveWhitespace)
          Initializes a new instance of the FormattedTextArea class.
FormattedTextArea(java.lang.String text, float x, float y, float width, float height, FormattedTextAreaStyle style)
          Initializes a new instance of the FormattedTextArea class.
 
Method Summary
protected  void drawRotated(PageWriter writer)
          Draws the text area to the given PageWriter object.
 FontFamilyList getFontFaces()
          Gets the List of FontFamily used by the Formatted text area.
 float getHeight()
          Gets the height of the Formatted text area.
 FormattedTextArea getOverflowFormattedTextArea()
          Returns a new FormattedTextArea object containing the overflow text.
 FormattedTextArea getOverflowFormattedTextArea(float x, float y)
          Returns a new FormattedTextArea object containing the overflow text.
 FormattedTextArea getOverflowFormattedTextArea(float x, float y, float height)
          Returns a new FormattedTextArea object containing the overflow text.
 float getRequiredHeight()
          Returns the required height to fit all of the text of the FormattedTextArea.
 FormattedTextAreaStyle getStyle()
          Gets FormattedTextAreaStyle object used to specify the initial style of the Formatted text area.
 java.lang.String getText()
          Gets the text for the Formatted text area.
 VAlign getVAlign()
          Gets a value indicating the vertical alignment of the formatted text area.
 float getWidth()
          Gets the width of the Formatted text area.
 boolean hasOverflowText()
          Returns a value specifying if there is text that did not fit in the FormattedTextArea.
 void setHeight(float value)
          Sets the height of the Formatted text area.
 void setStyle(FormattedTextAreaStyle value)
          Sets FormattedTextAreaStyle object used to specify the initial style of the Formatted text area.
 void setText(java.lang.String value)
          Sets the text for the Formatted text area.
 void setVAlign(VAlign vAlign)
          Sets a value indicating the vertical alignment of the formatted text area.
 void setWidth(float value)
          sets the width of the Formatted text area.
 
Methods inherited from class com.cete.dynamicpdf.pageelements.RotatingPageElement
draw, getAngle, getX, getY, setAngle, setX, setY
 
Methods inherited from class com.cete.dynamicpdf.pageelements.TaggablePageElement
getTag, getTagOrder, setTag, setTagOrder
 
Methods inherited from class com.cete.dynamicpdf.PageElement
getRequiredLicenseLevel, getStrID, setRequiredLicenseLevel, setStrID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.cete.dynamicpdf.pageelements.ICoordinate
getX, getY, setX, setY
 

Constructor Detail

FormattedTextArea

public FormattedTextArea(java.lang.String text,
                         float x,
                         float y,
                         float width,
                         float height,
                         FontFamily fontFamily,
                         float fontSize,
                         boolean preserveWhitespace)
Initializes a new instance of the FormattedTextArea class.

Parameters:
text - Text to display in the Formatted text area.
x - X coordinate of the Formatted text area.
y - Y coordinate of the Formatted text area.
width - Width of the Formatted text area.
height - Height of the Formatted text area.
fontFamily - Initial FontFamily of the Formatted text area.
fontSize - Initial font size of the Formatted text area.
preserveWhitespace - Specifies if white space should be preserved.
See Also:
FontFamily

FormattedTextArea

public FormattedTextArea(java.lang.String text,
                         float x,
                         float y,
                         float width,
                         float height,
                         FormattedTextAreaStyle style)
Initializes a new instance of the FormattedTextArea class.

Parameters:
text - Text to display in the Formatted text area.
x - X coordinate of the Formatted text area.
y - Y coordinate of the Formatted text area.
width - Width of the Formatted text area.
height - Height of the Formatted text area.
style - Initial FormattedTextAreaStyle of the Formatted text area.
See Also:
FormattedTextAreaStyle

FormattedTextArea

public FormattedTextArea(char[] text,
                         float x,
                         float y,
                         float width,
                         float height,
                         FontFamily fontFamily,
                         float fontSize,
                         boolean preserveWhitespace)
Initializes a new instance of the FormattedTextArea class.

Parameters:
text - Text to display in the Formatted text area.
x - X coordinate of the Formatted text area.
y - Y coordinate of the Formatted text area.
width - Width of the Formatted text area.
height - Height of the Formatted text area.
fontFamily - Initial FontFamily of the Formatted text area.
fontSize - Initial font size of the Formatted text area.
preserveWhitespace - Specifies if white space should be preserved.
See Also:
FontFamily

FormattedTextArea

public FormattedTextArea(char[] text,
                         float x,
                         float y,
                         float width,
                         float height,
                         FormattedTextAreaStyle style)
Initializes a new instance of the FormattedTextArea class.

Parameters:
text - Text to display in the Formatted text area.
x - X coordinate of the Formatted text area.
y - Y coordinate of the Formatted text area.
width - Width of the Formatted text area.
height - Height of the Formatted text area.
style - Initial FormattedTextAreaStyle of the Formatted text area.
See Also:
FormattedTextAreaStyle
Method Detail

getFontFaces

public FontFamilyList getFontFaces()
Gets the List of FontFamily used by the Formatted text area.

Returns:
FontFamilyList List of FontFamily used by the Formatted text area.
See Also:
FontFamilyList

getWidth

public float getWidth()
Gets the width of the Formatted text area.

Specified by:
getWidth in interface IArea
Returns:
float The width of the Formatted text area.

setWidth

public void setWidth(float value)
sets the width of the Formatted text area.

Specified by:
setWidth in interface IArea
Throws:
GeneratorException - If width is changed on an overflow FormattedTextArea
Parameters:
value - The width of the Formatted text area.

getHeight

public float getHeight()
Gets the height of the Formatted text area.

Specified by:
getHeight in interface IArea
Overrides:
getHeight in class RotatingPageElement
Returns:
float Height of the Formatted text area.

setHeight

public void setHeight(float value)
Sets the height of the Formatted text area.

Specified by:
setHeight in interface IArea
Overrides:
setHeight in class RotatingPageElement
Parameters:
value - Height of the Formatted text area.

getVAlign

public VAlign getVAlign()
Gets a value indicating the vertical alignment of the formatted text area.

Returns:
the vertical alignment of the formatted text area.

setVAlign

public void setVAlign(VAlign vAlign)
Sets a value indicating the vertical alignment of the formatted text area.

Parameters:
vAlign - Vertical alignment of the Formatted text area.

getText

public java.lang.String getText()
Gets the text for the Formatted text area.

Throws:
GeneratorException - If Text is read on an overflow FormattedTextArea.
Returns:
String Text for the Formatted text area.

setText

public void setText(java.lang.String value)
Sets the text for the Formatted text area.

Throws:
GeneratorException - If Text is changed on an overflow FormattedTextArea.
Parameters:
value - Text for the Formatted text area.

getStyle

public FormattedTextAreaStyle getStyle()
Gets FormattedTextAreaStyle object used to specify the initial style of the Formatted text area.

Returns:
FormattedTextAreaStyle Object used to specify the initial style of the Formatted text area.
See Also:
FormattedTextAreaStyle

setStyle

public void setStyle(FormattedTextAreaStyle value)
Sets FormattedTextAreaStyle object used to specify the initial style of the Formatted text area.

Throws:
GeneratorException - If Style is changed on an overflow FormattedTextArea.
Parameters:
value - FormattedTextAreaStyle Object used to specify the initial style of the Formatted text area.
See Also:
FormattedTextAreaStyle

drawRotated

protected void drawRotated(PageWriter writer)
Draws the text area to the given PageWriter object.

Specified by:
drawRotated in class RotatingPageElement
Parameters:
writer - PageWriter object to receive the Formatted text area's output.
See Also:
PageWriter

getOverflowFormattedTextArea

public FormattedTextArea getOverflowFormattedTextArea()
Returns a new FormattedTextArea object containing the overflow text. View Example

Returns:
FormattedTextArea reference if there is overflow text. Otherwise null.

getOverflowFormattedTextArea

public FormattedTextArea getOverflowFormattedTextArea(float x,
                                                      float y)
Returns a new FormattedTextArea object containing the overflow text. View Example

Parameters:
x - X coordinate of the new object.
y - Y coordinate of the new object.
Returns:
FormattedTextArea if there is overflow text. Otherwise null.

getOverflowFormattedTextArea

public FormattedTextArea getOverflowFormattedTextArea(float x,
                                                      float y,
                                                      float height)
Returns a new FormattedTextArea object containing the overflow text. View Example

Parameters:
x - X coordinate of the new object.
y - Y coordinate of the new object.
height - Height of the new object.
Returns:
FormattedTextArea if there is overflow text. Otherwise null.

getRequiredHeight

public float getRequiredHeight()
Returns the required height to fit all of the text of the FormattedTextArea.

Returns:
float Height required to fit all text.
See Also:
FormattedTextArea

hasOverflowText

public boolean hasOverflowText()
Returns a value specifying if there is text that did not fit in the FormattedTextArea.

Returns:
true, if the FormattedTextArea has overflow text. Otherwise false.
See Also:
FormattedTextArea

DynamicPDF by ceTe Software

API Reference for DynamicPDF v10.07 for Java generated on Aug 12, 2020
© Copyright 2020, ceTe Software