Package eu.europa.esig.dss.pdf
Class AnnotationBox
java.lang.Object
eu.europa.esig.dss.pdf.AnnotationBox
- All Implemented Interfaces:
Serializable
This class defines a PDF annotation dimension and position (note, shape, signature field, etc.)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAnnotationBox
(float minX, float minY, float maxX, float maxY) Default constructor (normalizes the provided properties)AnnotationBox
(SignatureFieldParameters fieldParameters) The constructor to instantiateAnnotationBox
fromSignatureFieldParameters
-
Method Summary
Modifier and TypeMethodDescriptionboolean
float
Returns a height of the boxfloat
getMaxX()
Returns an upper right X coordinatefloat
getMaxY()
Returns an upper right Y coordinatefloat
getMinX()
Returns a lower left X coordinatefloat
getMinY()
Returns a lower left Y coordinatefloat
getWidth()
Returns a width of the boxint
hashCode()
boolean
isOverlap
(AnnotationBox box) Checks if the currentAnnotationBox
overlaps with the givenbox
boolean
isOverlap
(PdfAnnotation pdfAnnotation) Checks if the currentAnnotationBox
overlaps with the givenpdfAnnotation
toPdfPageCoordinates
(float pageHeight) Deprecated.since DSS 6.3.toPdfPageCoordinates
(AnnotationBox pageBox) Creates a newAnnotationBox
mirrored vertically relatively to the givenpageBox
toString()
-
Constructor Details
-
AnnotationBox
public AnnotationBox(float minX, float minY, float maxX, float maxY) Default constructor (normalizes the provided properties)- Parameters:
minX
- the lower left X coordinateminY
- the lower left Y coordinatemaxX
- the upper right X coordinatemaxY
- the upper right Y coordinate
-
AnnotationBox
The constructor to instantiateAnnotationBox
fromSignatureFieldParameters
- Parameters:
fieldParameters
-SignatureFieldParameters
-
-
Method Details
-
getMinX
public float getMinX()Returns a lower left X coordinate- Returns:
- lower left X
-
getMinY
public float getMinY()Returns a lower left Y coordinate- Returns:
- lower left Y
-
getMaxX
public float getMaxX()Returns an upper right X coordinate- Returns:
- upper right X
-
getMaxY
public float getMaxY()Returns an upper right Y coordinate- Returns:
- upper right Y
-
getWidth
public float getWidth()Returns a width of the box- Returns:
- width
-
getHeight
public float getHeight()Returns a height of the box- Returns:
- height
-
toPdfPageCoordinates
Deprecated.since DSS 6.3. Please use#toPdfPageCoordinates(AnnotationBox pageBox)
method instead.Creates a newAnnotationBox
mirrored vertically relatively to the givenpageHeight
The basis for the method: in used pdf implementations the Y origin is bottom based, while in DSS parameters is top-based- Parameters:
pageHeight
- the height of a page the annotation box will be created on- Returns:
AnnotationBox
-
toPdfPageCoordinates
Creates a newAnnotationBox
mirrored vertically relatively to the givenpageBox
The basis for the method: in used pdf implementations the Y origin is bottom based, while in DSS parameters is top-based. This method also takes into account non-zero upper-left corner coordinates, when applicable.
- Parameters:
pageBox
-AnnotationBox
representing the page's box the new field will be created on- Returns:
AnnotationBox
-
isOverlap
Checks if the currentAnnotationBox
overlaps with the givenpdfAnnotation
- Parameters:
pdfAnnotation
-PdfAnnotation
to check against- Returns:
- TRUE when the current objects overlaps the annotation, FALSE otherwise
-
isOverlap
Checks if the currentAnnotationBox
overlaps with the givenbox
- Parameters:
box
-AnnotationBox
to check against- Returns:
- TRUE when the current objects overlaps
box
, FALSE otherwise
-
hashCode
public int hashCode() -
equals
-
toString
-