Home  Products  Purchase  Downloads  Demos  Forums  Blogs  Ticket  Wiki  API  Corporate

com.aspose.pdf.kit
Class FormattedText

java.lang.Object
  extended bycom.aspose.pdf.kit.FormattedText

public class FormattedText
extends java.lang.Object

Represents text with color, size, font settings.


Constructor Summary
FormattedText(java.lang.String text)
          Initializes the Formattedtext with default setting (Color = new Color(0,0,0), FontStyle.TimesRoman£¬EncodingType.Winansi,texSize = 12).
FormattedText(java.lang.String text, java.awt.Color color, java.lang.String textFont, java.lang.String textEncoding, boolean embedded, float textSize)
          Initializes the Formattedtext.
FormattedText(java.lang.String text, FontColor textColor, java.lang.String textFont, java.lang.String textEncoding, boolean embedded, float textSize)
          Initializes the Formattedtext.
 
Method Summary
 void addNewLineText(java.lang.String newLineText)
          Adds a new line to the FormattedText object and sets the newLineText to the next line's text.
 float getTextHeight()
          Gets the height of the string which the FormattedText object contains.
 float getTextWidth()
          Gets the width of the string which the FormattedText object contains.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormattedText

public FormattedText(java.lang.String text)
              throws java.io.IOException,
                     PdfKitException
Initializes the Formattedtext with default setting (Color = new Color(0,0,0), FontStyle.TimesRoman£¬EncodingType.Winansi,texSize = 12).

Parameters:
text - String The content in string.
Throws:
java.io.IOException
PdfKitException

FormattedText

public FormattedText(java.lang.String text,
                     FontColor textColor,
                     java.lang.String textFont,
                     java.lang.String textEncoding,
                     boolean embedded,
                     float textSize)
              throws java.io.IOException,
                     PdfKitException
Initializes the Formattedtext. Use this method before 2007/02/25. Aspose has upgraded to a new method FormattedText(String, Color, String, String, boolean, float). Please use new method after that date.

Parameters:
text - String The content in String.
textColor - FontColor The color of the text showed.
textFont - String The font of the text showed.
textEncoding - String The font of the text showed.
embedded - boolean If the font has to be embedded.
textSize - float The size of the text.
Throws:
java.io.IOException
PdfKitException

FormattedText

public FormattedText(java.lang.String text,
                     java.awt.Color color,
                     java.lang.String textFont,
                     java.lang.String textEncoding,
                     boolean embedded,
                     float textSize)
              throws java.io.IOException,
                     PdfKitException
Initializes the Formattedtext.

Parameters:
text - String The content in String.
color - Color The color of the text showed.
textFont - String The font of the text showed.
textEncoding - String The font of the text showed.
embedded - boolean If the font has to be embedded.
textSize - float The size of the text.
Throws:
java.io.IOException
PdfKitException
Method Detail

getTextWidth

public float getTextWidth()
Gets the width of the string which the FormattedText object contains.

Returns:
Width of the string.

getTextHeight

public float getTextHeight()
Gets the height of the string which the FormattedText object contains.

Returns:
Height of the string.

addNewLineText

public void addNewLineText(java.lang.String newLineText)
Adds a new line to the FormattedText object and sets the newLineText to the next line's text.

Parameters:
newLineText - The new line's text.