Class AnnotationBox

java.lang.Object
eu.europa.esig.dss.pdf.AnnotationBox
All Implemented Interfaces:
Serializable

public class AnnotationBox extends Object implements Serializable
This class defines a PDF annotation dimension and position (note, shape, signature field, etc.)
See Also:
  • 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 coordinate
      minY - the lower left Y coordinate
      maxX - the upper right X coordinate
      maxY - the upper right Y coordinate
    • AnnotationBox

      public AnnotationBox(SignatureFieldParameters fieldParameters)
      The constructor to instantiate AnnotationBox from SignatureFieldParameters
      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 public AnnotationBox toPdfPageCoordinates(float pageHeight)
      Deprecated.
      since DSS 6.3. Please use #toPdfPageCoordinates(AnnotationBox pageBox) method instead.
      Creates a new AnnotationBox mirrored vertically relatively to the given pageHeight 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

      public AnnotationBox toPdfPageCoordinates(AnnotationBox pageBox)
      Creates a new AnnotationBox mirrored vertically relatively to the given pageBox

      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

      public boolean isOverlap(PdfAnnotation pdfAnnotation)
      Checks if the current AnnotationBox overlaps with the given pdfAnnotation
      Parameters:
      pdfAnnotation - PdfAnnotation to check against
      Returns:
      TRUE when the current objects overlaps the annotation, FALSE otherwise
    • isOverlap

      public boolean isOverlap(AnnotationBox box)
      Checks if the current AnnotationBox overlaps with the given box
      Parameters:
      box - AnnotationBox to check against
      Returns:
      TRUE when the current objects overlaps box, FALSE otherwise
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object