Interface Line

    • Method Detail

      • getTextUnitCnt

        int getTextUnitCnt()
        Returns the number of TextUnits in this Line.
      • getTextUnit

        TextUnit getTextUnit​(int idx)
        Returns the TextUnit at the specified index.
      • remove

        TextUnit remove​(int idx)
        Removes the TextUnit at the specified index, and returns it.
      • getTextUnits

        List<TextUnit> getTextUnits()
        Returns a List view of the TextUnits held by this Line. This List is guaranteed to provide efficient random access.
      • spans

        List<Span> spans​(Direction basedir)
        Returns a list of Spans identified within this line of text. This allows for directionally-aware word-by-word iteration within a line: while the {code Line}'s direct storage of characters (via getTextUnit(int), etc) always holds them in a strictly left-to-right order, without explicitly representing spaces, the Spans returned from this method will:
        1. Contain explicitly-represented Spaces (as calculated by PDFxStream using adjacent characters' fonts and other metrics)
        2. Reorder the Word Spans in order to account for those words' aggregate directionality (either Direction.LTR or Direction.RTL.