Package com.inet.pdfc.textselection
Interface TextInfo
- All Superinterfaces:
Serializable
A model class for get some text information how the text, the position, the bounds etc.
This class is for the public api available
-
Method Summary
Modifier and TypeMethodDescriptiongetAreas()Get the areas of the TextInfo.Returns the bounds of the whole text info, SCALEDfloat[]Returns the width of all characters of the text in pixeldoubleReturns the height in pixelsgetLabel()String representation for the contentintGet the pageIndex of the TextInfodoubleGet the rotation of this element in radiansfloatgetScale()Get the scale of the BaseTextInfogetText()Returns the content of this text infocom.inet.pdfc.model.ElementTypegetType()Get the type of this elementintReturns the width of a whitespace using the font in thisTextInfoImplwith the size of this TextInfo multiplied by 20 and scaled.
This is used to determine whether two succeeding chunks belongs to one word.doublegetX()Returns the x-coordinate of the elementdoublegetY()Returns the y-coordinate of the elementbooleanisLeft()Get the left of the TextInfovoidsetScale(double scale) Re-scale the bounding-boxes of characters to the given scale.voidsetX(double x) x cooridnates in unscaled pagevoidsetY(double y) y cooridnates in unscaled page
-
Method Details
-
getAreas
List<Rectangle2D> getAreas()Get the areas of the TextInfo. This are the scaled bounding boxes of the characters.- Returns:
- the areas of the TextInfo
- Since:
- 4.0
-
getText
String getText()Returns the content of this text info- Returns:
- the content of this text info
- Since:
- 4.0
-
getX
double getX()Returns the x-coordinate of the element- Returns:
- the x to set, in unscaled page coordinates
- Since:
- 4.0
-
setX
void setX(double x) x cooridnates in unscaled page- Parameters:
x- - the x to set, in unscaled page coordinates- Since:
- 4.0
-
getY
double getY()Returns the y-coordinate of the element- Returns:
- the y-coordinate in unscaled page coordinates
- Since:
- 4.0
-
setY
void setY(double y) y cooridnates in unscaled page- Parameters:
y- - the y to set, in unscaled page coordinates- Since:
- 4.0
-
getHeight
double getHeight()Returns the height in pixels- Returns:
- the height in pixels
- Since:
- 4.0
-
isLeft
boolean isLeft()Get the left of the TextInfo- Returns:
- the left of the TextInfo
- Since:
- 4.0
-
getPageIndex
int getPageIndex()Get the pageIndex of the TextInfo- Returns:
- the pageIndex of the TextInfo
- Since:
- 4.0
-
getLabel
String getLabel()String representation for the content- Returns:
- a string representation for the content, never null
- Since:
- 4.0
-
getRotation
double getRotation()Get the rotation of this element in radians- Returns:
- the rotation of this element in radians
- Since:
- 4.0
-
getWhiteSpaceWidth
int getWhiteSpaceWidth()Returns the width of a whitespace using the font in thisTextInfoImplwith the size of this TextInfo multiplied by 20 and scaled.
This is used to determine whether two succeeding chunks belongs to one word.- Returns:
- the width of a whitespace or a fallback value if font has no whitespace.
- Since:
- 4.0
-
getBounds
Rectangle2D getBounds()Returns the bounds of the whole text info, SCALED- Returns:
- the bounds of the whole text info, SCALED
- Since:
- 4.0
-
getScale
float getScale()Get the scale of the BaseTextInfo- Returns:
- the scale of the BaseTextInfo
- Since:
- 4.0
-
setScale
void setScale(double scale) Re-scale the bounding-boxes of characters to the given scale.- Parameters:
scale- the new scale- Since:
- 4.0
-
getType
com.inet.pdfc.model.ElementType getType()Get the type of this element- Returns:
- the type of this element, not null
- Since:
- 4.0
-
getCharWidth
float[] getCharWidth()Returns the width of all characters of the text in pixel- Returns:
- the width of all characters of the text in pixel
- Since:
- 4.0
-