org.icepdf.core.pobjects.graphics.text
Class WordText
java.lang.Object
org.icepdf.core.pobjects.graphics.text.AbstractText
org.icepdf.core.pobjects.graphics.text.WordText
- All Implemented Interfaces:
- Text, TextSelect
public class WordText
- extends AbstractText
- implements TextSelect
Word text represents an individual word in the document. A word can
also represent white space between words th isWhiteSpace method can be used
to distguish between words and whiteSpace
If extracted text has extract white space then the space width fraction
can be adjusted. The deault value a 4th of the current character width. To
add more sapces the number can be increase or decrease to limit the number
of spaces that are added. The system property is as follows:
Default
org.icepdf.core.views.page.text.spaceFraction=4
- Since:
- 4.0
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
spaceFraction
public static int spaceFraction
WordText
public WordText()
isWhiteSpace
public boolean isWhiteSpace()
setWhiteSpace
public void setWhiteSpace(boolean whiteSpace)
detectSpace
protected boolean detectSpace(GlyphText sprite)
detectPunctuation
protected static boolean detectPunctuation(GlyphText sprite)
detectWhiteSpace
protected static boolean detectWhiteSpace(GlyphText sprite)
isPunctuation
public static boolean isPunctuation(int c)
isWhiteSpace
public static boolean isWhiteSpace(int c)
buildSpaceWord
protected WordText buildSpaceWord(GlyphText sprite)
addText
protected void addText(GlyphText sprite)
getBounds
public java.awt.geom.Rectangle2D.Float getBounds()
- Description copied from class:
AbstractText
- Gets the bounds of the respective text object.
- Specified by:
getBounds in interface Text- Specified by:
getBounds in class AbstractText
- Returns:
- bounds of text object.
getGlyphs
public java.util.ArrayList<GlyphText> getGlyphs()
getSelected
public java.lang.StringBuilder getSelected()
- Specified by:
getSelected in interface TextSelect
clearHighlighted
public void clearHighlighted()
- Specified by:
clearHighlighted in interface TextSelect
clearSelected
public void clearSelected()
- Specified by:
clearSelected in interface TextSelect
selectAll
public void selectAll()
- Specified by:
selectAll in interface TextSelect
getText
public java.lang.String getText()
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object