org.icepdf.core.pobjects.graphics.text
Class PageText

java.lang.Object
  extended by org.icepdf.core.pobjects.graphics.text.PageText
All Implemented Interfaces:
TextSelect

public class PageText
extends java.lang.Object
implements TextSelect

Page text represents the root element of a page's text hierarchy which looks something like this.

The hierarchy elements are build by the content parser when text extraction is enabled. It is build to seperate the huristics used to calculate word and line detection which is used for text extraction/search, search highlighting and text highlighting.

It very important to note that all coordinates system represented in this hierarchy of object has been normalized to the page space. This allows for object to be sorted and drawn. Also this structure is not used for page layout and painting. It is is used for painting text selectin via UI input or search. The seperation is needed so that the text represented in Page text can be padded and sorted to aid in text extraction readability.

Since:
4.0

Constructor Summary
PageText()
           
 
Method Summary
 void addGlyph(GlyphText sprite)
           
 void applyXObjectTransform(java.awt.geom.AffineTransform transform)
          Utility method to normalize text created in a Xform content stream and is only called from the contentParser when parsing 'Do' token.
 void clearHighlighted()
           
 void clearSelected()
           
 void deselectAll()
           
 void dispose()
           
 java.util.ArrayList<LineText> getPageLines()
           
 java.lang.StringBuilder getSelected()
           
 void newLine()
           
 void selectAll()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PageText

public PageText()
Method Detail

newLine

public void newLine()

addGlyph

public void addGlyph(GlyphText sprite)

getPageLines

public java.util.ArrayList<LineText> getPageLines()

applyXObjectTransform

public void applyXObjectTransform(java.awt.geom.AffineTransform transform)
Utility method to normalize text created in a Xform content stream and is only called from the contentParser when parsing 'Do' token.

Parameters:
transform - do matrix tranform

clearSelected

public void clearSelected()
Specified by:
clearSelected in interface TextSelect

clearHighlighted

public void clearHighlighted()
Specified by:
clearHighlighted in interface TextSelect

getSelected

public java.lang.StringBuilder getSelected()
Specified by:
getSelected in interface TextSelect

selectAll

public void selectAll()
Specified by:
selectAll in interface TextSelect

deselectAll

public void deselectAll()

dispose

public void dispose()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object