Class AnnotationBox

java.lang.Object
eu.europa.esig.dss.pdf.AnnotationBox

public class AnnotationBox
extends Object
This class defines a PDF annotation dimension and position (note, shape, signature field, etc.)
  • Constructor Summary

    Constructors
    Constructor Description
    AnnotationBox​(float minX, float minY, float maxX, float maxY)
    Default constructor
    AnnotationBox​(SignatureFieldParameters fieldParameters)
    The constructor to instantiate AnnotationBox from SignatureFieldParameters
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(Object obj)  
    float getHeight()
    Returns a height of the box
    float getMaxX()
    Returns an upper right X coordinate
    float getMaxY()
    Returns an upper right Y coordinate
    float getMinX()
    Returns a lower left X coordinate
    float getMinY()
    Returns a lower left Y coordinate
    float getWidth()
    Returns a width of the box
    int hashCode()  
    boolean isOverlap​(AnnotationBox box)
    Checks if the current AnnotationBox overlaps with the given box
    boolean isOverlap​(PdfAnnotation pdfAnnotation)
    Checks if the current AnnotationBox overlaps with the given pdfAnnotation
    AnnotationBox toPdfPageCoordinates​(float pageHeight)
    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
    String toString()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • AnnotationBox

      public AnnotationBox​(float minX, float minY, float maxX, float maxY)
      Default constructor
      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

      public AnnotationBox toPdfPageCoordinates​(float pageHeight)
      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
    • 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