Package eu.europa.esig.dss.pdf
Class PdfSignatureFieldPositionChecker
java.lang.Object
eu.europa.esig.dss.pdf.PdfSignatureFieldPositionChecker
This class is used to verify the correctness of a new signature field placement within a PDF document
-
Constructor Summary
ConstructorDescriptionDefault constructor to instantiate the checker -
Method Summary
Modifier and TypeMethodDescriptionvoid
assertSignatureFieldPositionValid
(PdfDocumentReader documentReader, AnnotationBox annotationBox, int pageNumber) This method verifies whetherannotationBox
can be placed withindocumentReader
on the page numberpageNumber
protected void
checkSignatureFieldAgainstPageDimensions
(AnnotationBox signatureFieldBox, AnnotationBox pageBox) This method verifies whether thesignatureFieldBox
is withinpageBox
protected void
checkSignatureFieldBoxOverlap
(AnnotationBox signatureFieldBox, List<PdfAnnotation> pdfAnnotations) This method verifies whether thesignatureFieldBox
overlaps with one of the extractedpdfAnnotations
void
setAlertOnDocumentReadException
(StatusAlert alertOnDocumentReadException) Sets a behavior to follow when aIOException
is thrown on an attempt to read document properties Default : ExceptionOnStatusAlert - throw the exceptionvoid
setAlertOnSignatureFieldOutsidePageDimensions
(StatusAlert alertOnSignatureFieldOutsidePageDimensions) Sets a behavior to follow when a new signature field is created outside the page's dimensions Default : ExceptionOnStatusAlert - throw the exceptionvoid
setAlertOnSignatureFieldOverlap
(StatusAlert alertOnSignatureFieldOverlap) Sets alert on a signature field overlap with existing fields or/and annotations Default : ExceptionOnStatusAlert - throw the exception
-
Constructor Details
-
PdfSignatureFieldPositionChecker
public PdfSignatureFieldPositionChecker()Default constructor to instantiate the checker
-
-
Method Details
-
setAlertOnSignatureFieldOverlap
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
Sets a behavior to follow when aIOException
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 whetherannotationBox
can be placed withindocumentReader
on the page numberpageNumber
- Parameters:
documentReader
-PdfDocumentReader
document to create new signature field inannotationBox
-AnnotationBox
representing a signature field box to be createdpageNumber
- identifying a page number to be created
-
checkSignatureFieldBoxOverlap
protected void checkSignatureFieldBoxOverlap(AnnotationBox signatureFieldBox, List<PdfAnnotation> pdfAnnotations) This method verifies whether thesignatureFieldBox
overlaps with one of the extractedpdfAnnotations
- Parameters:
signatureFieldBox
-AnnotationBox
to verifypdfAnnotations
- a list ofAnnotationBox
to verify against
-
checkSignatureFieldAgainstPageDimensions
protected void checkSignatureFieldAgainstPageDimensions(AnnotationBox signatureFieldBox, AnnotationBox pageBox) This method verifies whether thesignatureFieldBox
is withinpageBox
- Parameters:
signatureFieldBox
-AnnotationBox
to checkpageBox
-AnnotationBox
representing the page's box
-