Class TextLine
Used to create text line objects.
public class TextLine : IBaselineDrawable, IDrawable
- Inheritance
-
TextLine
- Implements
- Inherited Members
Constructors
TextLine(Font)
Constructor for creating text line objects.
public TextLine(Font font)
Parameters
fontFontthe font to use.
TextLine(Font, string)
Constructor for creating text line objects.
public TextLine(Font font, string text)
Parameters
Methods
DrawOn(Page)
Draws this text line on the specified page.
public float[] DrawOn(Page page)
Parameters
pagePagethe page to draw this text line on.
Returns
- float[]
x and y coordinates of the bottom right corner of this component.
GetAltDescription()
Returns the alternate description of this text line.
public string GetAltDescription()
Returns
GetAscent()
Returns how far above its baseline this text line reaches.
public float GetAscent()
Returns
- float
the ascent of the font at the font size of this text line.
GetDecorationColor()
Returns a copy of the color of the underline and strikeout lines.
public float[] GetDecorationColor()
Returns
- float[]
GetDescent()
Returns how far below its baseline this text line reaches.
public float GetDescent()
Returns
- float
the descent of the font at the font size of this text line.
GetDestination()
Returns the name of the destination that DrawOn adds to the page.
public string GetDestination()
Returns
- string
the destination name, or null.
GetFallbackFont()
Returns the fallback font.
public Font GetFallbackFont()
Returns
- Font
the fallback font.
GetFont()
Gets the font to use for this text line.
public Font GetFont()
Returns
- Font
font the font to use.
GetFontSize()
Returns the font size.
public float GetFontSize()
Returns
GetGoToAction()
Returns the GoTo action string.
public string GetGoToAction()
Returns
- string
the GoTo action string.
GetHeight()
Returns the height of this TextLine.
public float GetHeight()
Returns
- float
the height.
GetHighlightColors()
Returns the colors used to highlight words in the text.
public Dictionary<string, int> GetHighlightColors()
Returns
GetLanguage()
Returns the language of the text.
public string GetLanguage()
Returns
GetLocation()
Returns the x coordinate of the start of the text and the y coordinate of its baseline.
public float[] GetLocation()
Returns
- float[]
GetScriptPosition()
Returns the script position.
public ScriptPosition GetScriptPosition()
Returns
- ScriptPosition
the script position.
GetStrikeout()
Returns the strikeout flag.
public bool GetStrikeout()
Returns
- bool
the strikeout flag.
GetText()
Returns the text.
public string GetText()
Returns
- string
the text.
GetTextColor()
Returns a copy of the text color.
public float[] GetTextColor()
Returns
- float[]
GetTextRotation()
Returns the text direction.
public int GetTextRotation()
Returns
- int
the text direction.
GetURIAction()
Returns the action URI.
public string GetURIAction()
Returns
- string
the action URI.
GetURIActualText()
Returns the actual text of the link annotation.
public string GetURIActualText()
Returns
GetURIAltDescription()
Returns the alternate description of the link annotation.
public string GetURIAltDescription()
Returns
GetURILanguage()
Returns the language of the link annotation.
public string GetURILanguage()
Returns
GetUnderline()
Returns the underline flag.
public bool GetUnderline()
Returns
- bool
the underline flag.
GetVerticalOffset()
Returns the vertical text offset: the one set with SetVerticalOffset, or that of the script position at the font and font size of this text line.
public float GetVerticalOffset()
Returns
- float
the vertical text offset.
GetWidth()
Returns the width of this TextLine.
public float GetWidth()
Returns
- float
the width.
SetAltDescription(string)
Sets the alternate description of this text line.
public TextLine SetAltDescription(string altDescription)
Parameters
altDescriptionstringthe alternate description of the text line.
Returns
- TextLine
this TextLine.
SetDecorationColor(int)
Sets the color of the underline and strikeout lines as a 0xRRGGBB value. Color.transparent leaves it unchanged.
public TextLine SetDecorationColor(int color)
Parameters
colorint
Returns
SetDecorationColor(float[])
Sets the color of the underline and strikeout lines from an array of red, green and blue values.
public TextLine SetDecorationColor(float[] rgbColor)
Parameters
rgbColorfloat[]
Returns
SetDestination(string)
Sets the name of a destination that DrawOn adds to the page, a font size above the baseline, so that a GoTo action with the name, which SetGoToAction sets, goes to this line.
public TextLine SetDestination(string name)
Parameters
namestringthe destination name, or null for none.
Returns
- TextLine
this TextLine.
SetFallbackFont(Font)
Sets the fallback font.
public TextLine SetFallbackFont(Font fallbackFont)
Parameters
fallbackFontFontthe fallback font.
Returns
- TextLine
this TextLine.
SetFont(Font)
Sets the font to use for this text line. The fallback font changes with it, unless a different fallback font was set.
public TextLine SetFont(Font font)
Parameters
fontFontthe font to use.
Returns
- TextLine
this TextLine.
SetFontSize(float)
Sets the font size to use for this text line.
public TextLine SetFontSize(float fontSize)
Parameters
fontSizefloatthe fontSize to use.
Returns
- TextLine
this TextLine.
SetGoToAction(string)
Sets the destination key for the action.
public TextLine SetGoToAction(string key)
Parameters
keystringthe destination name.
Returns
- TextLine
this TextLine.
SetHighlightColors(Dictionary<string, int>)
Sets the colors used to highlight words in the text.
public TextLine SetHighlightColors(Dictionary<string, int> colorMap)
Parameters
colorMapDictionary<string, int>
Returns
SetLanguage(string)
Sets the language of the text, for example "en-US".
public TextLine SetLanguage(string language)
Parameters
languagestring
Returns
SetLocation(float, float)
Sets the location where this text line will be drawn on the page.
public TextLine SetLocation(float x, float y)
Parameters
Returns
- TextLine
this TextLine.
SetScriptPosition(ScriptPosition)
Sets the script position. The offset of a superscript or subscript follows the font and font size of this text line when it is drawn.
public TextLine SetScriptPosition(ScriptPosition scriptPosition)
Parameters
scriptPositionScriptPositionScriptPosition.NORMAL, ScriptPosition.SUBSCRIPT or ScriptPosition.SUPERSCRIPT.
Returns
- TextLine
this TextLine.
SetStrikeout(bool)
Sets the strike variable. If the value of the strike variable is 'true' - a strike line is drawn through the text.
public TextLine SetStrikeout(bool strikeout)
Parameters
strikeoutboolthe strike value.
Returns
- TextLine
this TextLine.
SetStructureType(StructElem)
Sets the structure element type, for example StructElem.P or StructElem.H1.
public TextLine SetStructureType(StructElem structureType)
Parameters
structureTypeStructElem
Returns
SetText(string)
Sets the text.
public TextLine SetText(string text)
Parameters
textstringthe text.
Returns
- TextLine
this TextLine.
SetTextColor(int)
Sets the text color as a 0xRRGGBB value. Color.transparent leaves it unchanged.
public TextLine SetTextColor(int color)
Parameters
colorint
Returns
SetTextColor(float[])
Sets the text color from an array of red, green and blue values.
public TextLine SetTextColor(float[] rgbColor)
Parameters
rgbColorfloat[]
Returns
SetTextRotation(int)
Sets the rotation of the text. A positive angle turns clockwise, as every rotation in PDFjet turns, and a negative angle counterclockwise.
public TextLine SetTextRotation(int degrees)
Parameters
degreesintthe angle in degrees.
Returns
- TextLine
this TextLine.
SetURIAction(string)
Sets the URI for the "click text line" action.
public TextLine SetURIAction(string uri)
Parameters
uristringthe URI
Returns
- TextLine
this TextLine.
SetURIActualText(string)
Sets the actual text of the link annotation.
public TextLine SetURIActualText(string uriActualText)
Parameters
uriActualTextstring
Returns
SetURIAltDescription(string)
Sets the alternate description of the link annotation.
public TextLine SetURIAltDescription(string uriAltDescription)
Parameters
uriAltDescriptionstring
Returns
SetURILanguage(string)
Sets the language of the link annotation.
public TextLine SetURILanguage(string uriLanguage)
Parameters
uriLanguagestring
Returns
SetUnderline(bool)
Sets the underline variable. If the value of the underline variable is 'true' - the text is underlined.
public TextLine SetUnderline(bool underline)
Parameters
underlineboolthe underline flag.
Returns
- TextLine
this TextLine.
SetVerticalOffset(float)
Sets the vertical offset of the text, which replaces the offset of the script position until SetScriptPosition is called again.
public TextLine SetVerticalOffset(float verticalOffset)
Parameters
verticalOffsetfloatthe vertical offset.
Returns
- TextLine
this TextLine.