public interface Word extends TextElement<String>, Serializable
The Word interface represents a word within a relatively positioned rectangle in the GroupDocs.Viewer component. It extends the TextElement interface and provides additional methods to access and manipulate the word content.
Example usage:
try (Viewer viewer = new Viewer("document.pdf")) {
PdfViewInfo viewInfo = (PdfViewInfo) viewer.getViewInfo(ViewInfoOptions.forHtmlView());
List<Word> words = viewInfo.getPages().get(0).getLines().get(0).getWords();
for (Word word : words) {
// Use the word object for further operations
}
}
Note: The default implementation of this interface is WordImpl.
Viewer,
PdfViewInfo,
ViewInfoOptions| Modifier and Type | Method and Description |
|---|---|
List<Character> |
getCharacters()
Retrieves the characters contained by the word.
|
void |
setCharacters(List<Character> characters)
Sets the characters contained by the word.
|
Copyright © 2024. All rights reserved.