Package com.inet.pdfc.textselection
Interface TextInfo
-
- All Superinterfaces:
java.io.Serializable
@JsonData public interface TextInfo extends java.io.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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<java.awt.geom.Rectangle2D>
getAreas()
Get the areas of the TextInfo.java.awt.geom.Rectangle2D
getBounds()
Returns the bounds of the whole text info, SCALEDfloat[]
getCharWidth()
Returns the width of all characters of the text in pixeldouble
getHeight()
Returns the height in pixelsjava.lang.String
getLabel()
String representation for the contentint
getPageIndex()
Get the pageIndex of the TextInfodouble
getRotation()
Get the rotation of this element in radiansfloat
getScale()
Get the scale of the BaseTextInfojava.lang.String
getText()
Returns the content of this text infocom.inet.pdfc.model.ElementType
getType()
Get the type of this elementint
getWhiteSpaceWidth()
Returns the width of a whitespace using the font in thisTextInfoImpl
with the size of this TextInfo multiplied by 20 and scaled.
This is used to determine whether two succeeding chunks belongs to one word.double
getX()
Returns the x-coordinate of the elementdouble
getY()
Returns the y-coordinate of the elementboolean
isLeft()
Get the left of the TextInfovoid
setScale(double scale)
Re-scale the bounding-boxes of characters to the given scale.void
setX(double x)
x cooridnates in unscaled pagevoid
setY(double y)
y cooridnates in unscaled page
-
-
-
Method Detail
-
getAreas
java.util.List<java.awt.geom.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
java.lang.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
java.lang.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 thisTextInfoImpl
with 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
java.awt.geom.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
-
-