Interface TextInfo

All Superinterfaces:
Serializable

@JsonData public interface TextInfo extends Serializable
A model class for get some text information how the text, the position, the bounds etc. This class is for the public api available
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the areas of the TextInfo.
    Returns the bounds of the whole text info, SCALED
    float[]
    Returns the width of all characters of the text in pixel
    double
    Returns the height in pixels
    String representation for the content
    int
    Get the pageIndex of the TextInfo
    double
    Get the rotation of this element in radians
    float
    Get the scale of the BaseTextInfo
    Returns the content of this text info
    com.inet.pdfc.model.ElementType
    Get the type of this element
    int
    Returns the width of a whitespace using the font in this TextInfoImpl with the size of this TextInfo multiplied by 20 and scaled.
    This is used to determine whether two succeeding chunks belongs to one word.
    double
    Returns the x-coordinate of the element
    double
    Returns the y-coordinate of the element
    boolean
    Get the left of the TextInfo
    void
    setScale(double scale)
    Re-scale the bounding-boxes of characters to the given scale.
    void
    setX(double x)
    x cooridnates in unscaled page
    void
    setY(double y)
    y cooridnates in unscaled page
  • Method Details

    • getAreas

      List<Rectangle2D> getAreas()
      Get the areas of the TextInfo. This are the scaled bounding boxes of the characters.
      Returns:
      the areas of the TextInfo
      Since:
      4.0
    • getText

      String getText()
      Returns the content of this text info
      Returns:
      the content of this text info
      Since:
      4.0
    • getX

      double getX()
      Returns the x-coordinate of the element
      Returns:
      the x to set, in unscaled page coordinates
      Since:
      4.0
    • setX

      void setX(double x)
      x cooridnates in unscaled page
      Parameters:
      x - - the x to set, in unscaled page coordinates
      Since:
      4.0
    • getY

      double getY()
      Returns the y-coordinate of the element
      Returns:
      the y-coordinate in unscaled page coordinates
      Since:
      4.0
    • setY

      void setY(double y)
      y cooridnates in unscaled page
      Parameters:
      y - - the y to set, in unscaled page coordinates
      Since:
      4.0
    • getHeight

      double getHeight()
      Returns the height in pixels
      Returns:
      the height in pixels
      Since:
      4.0
    • isLeft

      boolean isLeft()
      Get the left of the TextInfo
      Returns:
      the left of the TextInfo
      Since:
      4.0
    • getPageIndex

      int getPageIndex()
      Get the pageIndex of the TextInfo
      Returns:
      the pageIndex of the TextInfo
      Since:
      4.0
    • getLabel

      String getLabel()
      String representation for the content
      Returns:
      a string representation for the content, never null
      Since:
      4.0
    • getRotation

      double getRotation()
      Get the rotation of this element in radians
      Returns:
      the rotation of this element in radians
      Since:
      4.0
    • getWhiteSpaceWidth

      int getWhiteSpaceWidth()
      Returns the width of a whitespace using the font in this TextInfoImpl with the size of this TextInfo multiplied by 20 and scaled.
      This is used to determine whether two succeeding chunks belongs to one word.
      Returns:
      the width of a whitespace or a fallback value if font has no whitespace.
      Since:
      4.0
    • getBounds

      Rectangle2D getBounds()
      Returns the bounds of the whole text info, SCALED
      Returns:
      the bounds of the whole text info, SCALED
      Since:
      4.0
    • getScale

      float getScale()
      Get the scale of the BaseTextInfo
      Returns:
      the scale of the BaseTextInfo
      Since:
      4.0
    • setScale

      void setScale(double scale)
      Re-scale the bounding-boxes of characters to the given scale.
      Parameters:
      scale - the new scale
      Since:
      4.0
    • getType

      com.inet.pdfc.model.ElementType getType()
      Get the type of this element
      Returns:
      the type of this element, not null
      Since:
      4.0
    • getCharWidth

      float[] getCharWidth()
      Returns the width of all characters of the text in pixel
      Returns:
      the width of all characters of the text in pixel
      Since:
      4.0