public class Word
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
void |
delete() |
java.util.EnumSet<WordAttributeFlags> |
getAttributes()
Gets a set of summary flags containing information on the types of characters in a word.
|
java.util.List<Quad> |
getCharQuads()
Gets a list of Quads occupied by the individual characters in a word.
|
boolean |
getIsLastWordInRegion()
Specifies whether this word is the last word in a region as determined by the WordFinder.
|
java.util.List<Quad> |
getQuads()
Gets the specified word's quads, specified in user space coordinates.
|
java.util.List<StyleTransition> |
getStyleTransitions()
Gets a list of style transitions for the word.
|
java.lang.String |
getText()
Gets a word's text and also converts ligatures to their constituent characters.
|
public void delete()
public java.lang.String getText()
public java.util.List<Quad> getQuads()
The quad's height is the height of the font's bounding box, not the height of the tallest character used in the word. The font's bounding box is determined by the glyphs in the font that extend farthest above and below the baseline; it often extends somewhat above the top of 'A' and below the bottom of 'y'.
The quad's width is determined from the characters actually present in the word.
For example, the quads for the words "AWAY" and "away" have the same height, but generally do not have the same width unless the font is a mono-spaced font (a font in which all characters have the same width).
Despite the names of the fields in an Quad (TopLeft for top left, BottomLeft for bottom left, and so forth) the corners of Quad do not necessarily have these positions.
public java.util.List<Quad> getCharQuads()
public java.util.List<StyleTransition> getStyleTransitions()
public java.util.EnumSet<WordAttributeFlags> getAttributes()
public boolean getIsLastWordInRegion()
This can be useful for determining visual line breaks in tagged PDFs. In tagged PDF documents, WordAttributeFlags.LastWordOnLine is set according to the tags in the document, so that flag cannot be used to determine visual line breaks.