com.teamdev.jxdocument
Class Text

java.lang.Object
  extended by com.teamdev.jxdocument.Text

public class Text
extends java.lang.Object

Text representation of a specified PDF Page.


Method Summary
 int getCharsCount()
          Returns number of characters in the page.
 java.lang.String getText()
          Returns unicode text string that represents all text on the page.
 java.lang.String getText(int beginIndex, int charsCount)
          Returns unicode text string on the page at specified offset (beginIndex) and with the required length (charsCount).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCharsCount

public int getCharsCount()
Returns number of characters in the page. Generated characters, like additional space characters, new line characters, are also counted.

Returns:
number of characters in the page.
Throws:
java.lang.IllegalStateException - when page is closed.

getText

public java.lang.String getText(int beginIndex,
                                int charsCount)
Returns unicode text string on the page at specified offset (beginIndex) and with the required length (charsCount). This method ignores characters without unicode information.

Parameters:
beginIndex - the beginning index, inclusive.
charsCount - number of characters. Must be > 0.
Returns:
unicode text string on the page.
Throws:
java.lang.IllegalArgumentException - when beginIndex is negative or higher then total number of characters; when charsCount is negative or 0.
java.lang.IllegalStateException - when page is closed.

getText

public java.lang.String getText()
Returns unicode text string that represents all text on the page. This method ignores characters without unicode information.

Returns:
unicode text string on the page or empty string if there's no text.
Throws:
java.lang.IllegalStateException - when page is closed.