iText 8.0.2 API
iText.Layout.Element.Text Class Reference

A Text is a piece of text of any length. More...

Inheritance diagram for iText.Layout.Element.Text:
iText.Layout.Element.AbstractElement< iText.Layout.Element.Text > iText.Layout.Element.ILeafElement iText.Layout.Tagging.IAccessibleElement iText.Layout.Element.IElement iText.Layout.IPropertyContainer iText.Layout.Element.Link

Public Member Functions

  Text (String text)
  Constructs a Text with its role initialized. More...
 
virtual String  GetText ()
  Gets the contents of the Text object that will be rendered. More...
 
virtual void  SetText (String text)
  Sets the contents of the Text object. More...
 
virtual float  GetTextRise ()
  Gets the text rise. More...
 
virtual iText.Layout.Element.Text  SetTextRise (float textRise)
  Sets the text rise. More...
 
virtual ? float  GetHorizontalScaling ()
  Gets the horizontal scaling property, which determines how wide the text should be stretched. More...
 
virtual iText.Layout.Element.Text  SetSkew (float alpha, float beta)
  Skews the text to simulate italic and other effects. More...
 
virtual iText.Layout.Element.Text  SetHorizontalScaling (float horizontalScaling)
  The horizontal scaling parameter adjusts the width of glyphs by stretching or compressing them in the horizontal direction. More...
 
virtual AccessibilityProperties  GetAccessibilityProperties ()
  Gets the accessibility properties. More...
 
virtual iText.Layout.Element.Text  SetNeutralRole ()
  Give this element a neutral role. More...
 
- Public Member Functions inherited from iText.Layout.Element.AbstractElement< iText.Layout.Element.Text >
virtual IRenderer  GetRenderer ()
  Gets a renderer for this element. More...
 
virtual void  SetNextRenderer (IRenderer renderer)
  Overrides the iText.Layout.Renderer.IRenderer instance which will be returned by the next call to the GetRenderer(). More...
 
virtual IRenderer  CreateRendererSubTree ()
  Creates a renderer subtree with root in the current element. More...
 
override bool  HasProperty (int property)
  Checks if this entity has the specified property. More...
 
override T1  GetProperty< T1 > (int property)
  Gets the property from this entity. More...
 
virtual T  AddStyle (Style style)
  Add a new style to this element. More...
 
virtual IList< IElement GetChildren ()
  Gets the child elements of this elements More...
 
virtual bool  IsEmpty ()
  Returns true if this list contains no elements. More...
 
virtual T  SetAction (PdfAction action)
  Sets an action on this Element. More...
 
virtual T  SetPageNumber (int pageNumber)
  Explicitly sets the page number this element should be put on. More...
 
- Public Member Functions inherited from iText.Layout.Element.IElement
void  SetNextRenderer (IRenderer renderer)
  Overrides the iText.Layout.Renderer.IRenderer instance which will be returned by the next call to the GetRenderer(). More...
 
IRenderer  GetRenderer ()
  Gets a renderer for this element. More...
 
IRenderer  CreateRendererSubTree ()
  Creates a renderer subtree with root in the current element. More...
 
- Public Member Functions inherited from iText.Layout.IPropertyContainer
bool  HasProperty (int property)
  Checks if this entity has the specified property. More...
 
bool  HasOwnProperty (int property)
  Checks if this entity has the specified property, i.e. if it was set to this very element earlier More...
 
T1  GetProperty< T1 > (int property)
  Gets the property from this entity. More...
 
T1  GetOwnProperty< T1 > (int property)
  Gets own property from this entity. More...
 
T1  GetDefaultProperty< T1 > (int property)
  Gets the default property from this entity. More...
 
void  SetProperty (int property, Object value)
  Sets a property for this entity. More...
 
void  DeleteOwnProperty (int property)
  Deletes the own property of this entity. More...
 

Detailed Description

A Text is a piece of text of any length.

A Text is a piece of text of any length. As a leaf element , it is the smallest piece of content that may bear specific layout attributes.

Constructor & Destructor Documentation

◆ Text()

iText.Layout.Element.Text.Text ( String  text )
inline

Constructs a Text with its role initialized.

Parameters
text the contents, as a System.String

Member Function Documentation

◆ GetAccessibilityProperties()

virtual AccessibilityProperties iText.Layout.Element.Text.GetAccessibilityProperties ( )
inlinevirtual

Gets the accessibility properties.

Gets the accessibility properties . See also IAccessibleElement.

Returns
an interface that allows to specify properties of a tagged element in Tagged PDF.

Implements iText.Layout.Tagging.IAccessibleElement.

Reimplemented in iText.Layout.Element.Link.

◆ GetHorizontalScaling()

virtual ? float iText.Layout.Element.Text.GetHorizontalScaling ( )
inlinevirtual

Gets the horizontal scaling property, which determines how wide the text should be stretched.

Returns
the horizontal spacing, as a float

◆ GetText()

virtual String iText.Layout.Element.Text.GetText ( )
inlinevirtual

Gets the contents of the Text object that will be rendered.

Returns
the string with the contents

◆ GetTextRise()

virtual float iText.Layout.Element.Text.GetTextRise ( )
inlinevirtual

Gets the text rise.

Returns
the vertical distance from the text's default base line, as a float.

◆ SetHorizontalScaling()

virtual iText.Layout.Element.Text iText.Layout.Element.Text.SetHorizontalScaling ( float  horizontalScaling )
inlinevirtual

The horizontal scaling parameter adjusts the width of glyphs by stretching or compressing them in the horizontal direction.

Parameters
horizontalScaling the scaling parameter. 1 means no scaling will be applied, 0.5 means the text will be scaled by half. 2 means the text will be twice as wide as normal one.
Returns
this Text

◆ SetNeutralRole()

virtual iText.Layout.Element.Text iText.Layout.Element.Text.SetNeutralRole ( )
inlinevirtual

Give this element a neutral role.

Give this element a neutral role. See also iText.Kernel.Pdf.Tagutils.AccessibilityProperties.SetRole(System.String).

Returns
this Element

◆ SetSkew()

virtual iText.Layout.Element.Text iText.Layout.Element.Text.SetSkew ( float  alpha,
float  beta 
)
inlinevirtual

Skews the text to simulate italic and other effects.

Skews the text to simulate italic and other effects. Try alpha=0 and beta=12.

Parameters
alpha the first angle in degrees
beta the second angle in degrees
Returns
this Text

◆ SetText()

virtual void iText.Layout.Element.Text.SetText ( String  text )
inlinevirtual

Sets the contents of the Text object.

Parameters
text the new contents

◆ SetTextRise()

virtual iText.Layout.Element.Text iText.Layout.Element.Text.SetTextRise ( float  textRise )
inlinevirtual

Sets the text rise.

Parameters
textRise a vertical distance from the text's default base line.
Returns
this Text