Package eu.europa.esig.dss.pdf
Class AnnotationBox
java.lang.Object
eu.europa.esig.dss.pdf.AnnotationBox
This class defines a PDF annotation dimension and position (note, shape, signature field, etc.)
-
Constructor Summary
ConstructorsConstructorDescriptionAnnotationBox(float minX, float minY, float maxX, float maxY) Default constructor (normalizes the provided properties)AnnotationBox(SignatureFieldParameters fieldParameters) The constructor to instantiateAnnotationBoxfromSignatureFieldParameters -
Method Summary
Modifier and TypeMethodDescriptionbooleanfloatReturns a height of the boxfloatgetMaxX()Returns an upper right X coordinatefloatgetMaxY()Returns an upper right Y coordinatefloatgetMinX()Returns a lower left X coordinatefloatgetMinY()Returns a lower left Y coordinatefloatgetWidth()Returns a width of the boxinthashCode()booleanisOverlap(AnnotationBox box) Checks if the currentAnnotationBoxoverlaps with the givenboxbooleanisOverlap(PdfAnnotation pdfAnnotation) Checks if the currentAnnotationBoxoverlaps with the givenpdfAnnotationtoPdfPageCoordinates(float pageHeight) Creates a newAnnotationBoxmirrored vertically relatively to the givenpageHeightThe basis for the method: in used pdf implementations the Y origin is bottom based, while in DSS parameters is top-basedtoString()
-
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 instantiateAnnotationBoxfromSignatureFieldParameters- 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
Creates a newAnnotationBoxmirrored vertically relatively to the givenpageHeightThe 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
-
isOverlap
Checks if the currentAnnotationBoxoverlaps with the givenpdfAnnotation- Parameters:
pdfAnnotation-PdfAnnotationto check against- Returns:
- TRUE when the current objects overlaps the annotation, FALSE otherwise
-
isOverlap
Checks if the currentAnnotationBoxoverlaps with the givenbox- Parameters:
box-AnnotationBoxto check against- Returns:
- TRUE when the current objects overlaps
box, FALSE otherwise
-
hashCode
public int hashCode() -
equals
-
toString
-