Class PdfSignatureFieldPositionChecker

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

public class PdfSignatureFieldPositionChecker extends Object
This class is used to verify the correctness of a new signature field placement within a PDF document
  • Constructor Details

    • PdfSignatureFieldPositionChecker

      public PdfSignatureFieldPositionChecker()
      Default constructor to instantiate the checker
  • Method Details

    • setAlertOnSignatureFieldOverlap

      public void setAlertOnSignatureFieldOverlap(StatusAlert alertOnSignatureFieldOverlap)
      Sets alert on a signature field overlap with existing fields or/and annotations Default : ExceptionOnStatusAlert - throw the exception
      Parameters:
      alertOnSignatureFieldOverlap - StatusAlert to execute
    • setAlertOnSignatureFieldOutsidePageDimensions

      public void setAlertOnSignatureFieldOutsidePageDimensions(StatusAlert alertOnSignatureFieldOutsidePageDimensions)
      Sets a behavior to follow when a new signature field is created outside the page's dimensions Default : ExceptionOnStatusAlert - throw the exception
      Parameters:
      alertOnSignatureFieldOutsidePageDimensions - StatusAlert to execute
    • setAlertOnDocumentReadException

      public void setAlertOnDocumentReadException(StatusAlert alertOnDocumentReadException)
      Sets a behavior to follow when a IOException is thrown on an attempt to read document properties Default : ExceptionOnStatusAlert - throw the exception
      Parameters:
      alertOnDocumentReadException - StatusAlert to execute
    • assertSignatureFieldPositionValid

      public void assertSignatureFieldPositionValid(PdfDocumentReader documentReader, AnnotationBox annotationBox, int pageNumber)
      This method verifies whether annotationBox can be placed within documentReader on the page number pageNumber
      Parameters:
      documentReader - PdfDocumentReader document to create new signature field in
      annotationBox - AnnotationBox representing a signature field box to be created
      pageNumber - identifying a page number to be created
    • checkSignatureFieldBoxOverlap

      protected void checkSignatureFieldBoxOverlap(AnnotationBox signatureFieldBox, List<PdfAnnotation> pdfAnnotations)
      This method verifies whether the signatureFieldBox overlaps with one of the extracted pdfAnnotations
      Parameters:
      signatureFieldBox - AnnotationBox to verify
      pdfAnnotations - a list of AnnotationBox to verify against
    • checkSignatureFieldAgainstPageDimensions

      protected void checkSignatureFieldAgainstPageDimensions(AnnotationBox signatureFieldBox, AnnotationBox pageBox)
      This method verifies whether the signatureFieldBox is within pageBox
      Parameters:
      signatureFieldBox - AnnotationBox to check
      pageBox - AnnotationBox representing the page's box