public class Text extends AbstractElement<Text> implements ILeafElement, IAccessibleElement
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.| Modifier and Type | Field and Description |
|---|---|
protected PdfName |
role |
protected AccessibilityProperties |
tagProperties |
protected String |
text |
childElements, nextRenderer, stylesproperties| Constructor and Description |
|---|
Text(String text)
Constructs a Text with its role initialized.
|
| Modifier and Type | Method and Description |
|---|---|
AccessibilityProperties |
getAccessibilityProperties() |
<T1> T1 |
getDefaultProperty(int property)
Gets the default property from this entity.
|
Float |
getHorizontalScaling()
Gets the horizontal scaling property, which determines how wide the text
should be stretched.
|
PdfName |
getRole() |
String |
getText() |
float |
getTextRise()
Gets the text rise.
|
protected IRenderer |
makeNewRenderer() |
Text |
setHorizontalScaling(float horizontalScaling)
The horizontal scaling parameter adjusts the width of glyphs by stretching or
compressing them in the horizontal direction.
|
void |
setRole(PdfName role) |
Text |
setSkew(float alpha,
float beta)
Skews the text to simulate italic and other effects.
|
void |
setText(String text) |
Text |
setTextRise(float textRise)
Sets the text rise.
|
addStyle, createRendererSubTree, getProperty, getRenderer, hasProperty, isEmpty, propagateArtifactRoleToChildElements, setAction, setNextRenderer, setPageNumberdeleteOwnProperty, getHeight, getOwnProperty, getSplitCharacters, getStrokeColor, getStrokeWidth, getTextRenderingMode, getWidth, hasOwnProperty, setBackgroundColor, setBackgroundColor, setBaseDirection, setBold, setBorder, setBorderBottom, setBorderLeft, setBorderRight, setBorderTop, setCharacterSpacing, setDestination, setFixedPosition, setFixedPosition, setFixedPosition, setFixedPosition, setFont, setFontColor, setFontKerning, setFontScript, setFontSize, setHeight, setHorizontalAlignment, setHyphenation, setItalic, setLineThrough, setProperty, setRelativePosition, setSplitCharacters, setStrokeColor, setStrokeWidth, setTextAlignment, setTextRenderingMode, setUnderline, setUnderline, setUnderline, setWidth, setWidth, setWidthPercent, setWordSpacingclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateRendererSubTree, getRenderer, setNextRendererdeleteOwnProperty, getOwnProperty, getProperty, hasOwnProperty, hasProperty, setPropertyprotected String text
protected PdfName role
protected AccessibilityProperties tagProperties
public <T1> T1 getDefaultProperty(int property)
IPropertyContainergetDefaultProperty in interface IPropertyContainergetDefaultProperty in class ElementPropertyContainer<Text>T1 - the return type associated with the propertyproperty - the property to be retrievednull will be returnedpublic String getText()
public void setText(String text)
public float getTextRise()
public Text setTextRise(float textRise)
textRise - a vertical distance from the text's default base line.public Float getHorizontalScaling()
floatpublic Text setSkew(float alpha, float beta)
alpha=0
and beta=12.alpha - the first angle in degreesbeta - the second angle in degreesTextpublic Text setHorizontalScaling(float horizontalScaling)
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.public PdfName getRole()
getRole in interface IAccessibleElementpublic void setRole(PdfName role)
setRole in interface IAccessibleElementpublic AccessibilityProperties getAccessibilityProperties()
getAccessibilityProperties in interface IAccessibleElementprotected IRenderer makeNewRenderer()
makeNewRenderer in class AbstractElement<Text>Copyright © 1998–2016 iText Group NV. All rights reserved.