Class TextRun

java.lang.Object
com.datalogics.PDFL.Element
com.datalogics.PDFL.TextRun

public class TextRun extends Element
Represents one or more contiguous characters in a text object. All the characters contained within a text run have the same style, color, font, and size.
  • Constructor Details

  • Method Details

    • delete

      public void delete()
      Overrides:
      delete in class Element
    • getText

      public String getText()
      The text of this TextRun.
    • setText

      public void setText(String text)
      The text of this TextRun.
    • getRawText

      public byte[] getRawText()
      The raw, un-interpreted text as char codes of this TextRun.
    • getFont

      public Font getFont()
      The font of this TextRun.
    • setFont

      public void setFont(Font font)
      The font of this TextRun.

    • getAdvance

      public double getAdvance()
      Deprecated, use Text.GetAdvanceForTextRun(int textRunIndex) instead. This version does not indicate the direction of the advance width.

      The advance width of this run of text.

      The advnace width is the amount by which the current point advances when the text run is drawn. Advance width is returned in user space.

    • getTextState

      public TextState getTextState()
      The TextState of this TextRun.
    • getGraphicState

      public GraphicState getGraphicState()
      Get the graphic state of the text run.

      May return null if this element does not have a GraphicState.

    • setGraphicState

      public void setGraphicState(GraphicState gstate)
      Set the Graphic State of the text run.
      Parameters:
      gstate - the new/updated Graphic State for the text run.