com.itextpdf.text.pdf.parser
Class TextRenderInfo

java.lang.Object
  extended by com.itextpdf.text.pdf.parser.TextRenderInfo

public class TextRenderInfo
extends Object

Provides information and calculations needed by render listeners to display/evaluate text render operations.

This is passed between the PdfContentStreamProcessor and RenderListener objects as text rendering operations are discovered


Method Summary
 LineSegment getAscentLine()
          Gets the ascentline for the text (i.e.
 LineSegment getBaseline()
          Gets the baseline for the text (i.e.
 LineSegment getDescentLine()
          Gets the descentline for the text (i.e.
 DocumentFont getFont()
          Getter for the font
 float getSingleSpaceWidth()
           
 String getText()
           
 int getTextRenderMode()
           
 boolean hasMcid(int mcid)
          Checks if the text belongs to a marked content sequence with a given mcid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getText

public String getText()
Returns:
the text to render

hasMcid

public boolean hasMcid(int mcid)
Checks if the text belongs to a marked content sequence with a given mcid.

Parameters:
mcid - a marked content id
Returns:
true if the text is marked with this id
Since:
5.0.2

getBaseline

public LineSegment getBaseline()
Gets the baseline for the text (i.e. the line that the text 'sits' on)

Returns:
the baseline line segment
Since:
5.0.2

getAscentLine

public LineSegment getAscentLine()
Gets the ascentline for the text (i.e. the line that represents the topmost extent that a string of the current font could have)

Returns:
the ascentline line segment
Since:
5.0.2

getDescentLine

public LineSegment getDescentLine()
Gets the descentline for the text (i.e. the line that represents the bottom most extent that a string of the current font could have)

Returns:
the descentline line segment
Since:
5.0.2

getFont

public DocumentFont getFont()
Getter for the font

Returns:
the font
Since:
iText 5.0.2

getSingleSpaceWidth

public float getSingleSpaceWidth()
Returns:
The width, in user space units, of a single space character in the current font

getTextRenderMode

public int getTextRenderMode()
Returns:
the text render mode that should be used for the text. From the PDF specification, this means:
  • 0 = Fill text
  • 1 = Stroke text
  • 2 = Fill, then stroke text
  • 3 = Invisible
  • 4 = Fill text and add to path for clipping
  • 5 = Stroke text and add to path for clipping
  • 6 = Fill, then stroke text and add to path for clipping
  • 7 = Add text to padd for clipping
Since:
iText 5.0.1