Class TextElement

All Implemented Interfaces:
Shape, Serializable, Cloneable, HasText

public class TextElement extends Rectangle implements HasText
See Also:
  • Constructor Details

    • TextElement

      public TextElement(float y, float x, float width, float height, org.apache.pdfbox.pdmodel.font.PDFont font, float fontSize, String c, float widthOfSpace)
    • TextElement

      public TextElement(float y, float x, float width, float height, org.apache.pdfbox.pdmodel.font.PDFont font, float fontSize, String c, float widthOfSpace, float dir)
  • Method Details

    • getText

      public String getText()
      Specified by:
      getText in interface HasText
    • getText

      public String getText(boolean useLineReturns)
      Specified by:
      getText in interface HasText
    • getDirection

      public float getDirection()
    • getWidthOfSpace

      public float getWidthOfSpace()
    • getFont

      public org.apache.pdfbox.pdmodel.font.PDFont getFont()
    • getFontSize

      public float getFontSize()
    • toString

      public String toString()
      Overrides:
      toString in class Rectangle
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Rectangle2D
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Rectangle2D
    • mergeWords

      public static List<TextChunk> mergeWords(List<TextElement> textElements)
    • mergeWords

      public static List<TextChunk> mergeWords(List<TextElement> textElements, List<Ruling> verticalRulings)
      heuristically merge a list of TextElement into a list of TextChunk ported from from PDFBox's PDFTextStripper.writePage, with modifications. Here be dragons