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
ConstructorsConstructorDescriptionDefault constructor to instantiate the checker -
Method Summary
Modifier and TypeMethodDescriptionvoidassertSignatureFieldPositionValid(PdfDocumentReader documentReader, AnnotationBox annotationBox, int pageNumber) This method verifies whetherannotationBoxcan be placed withindocumentReaderon the page numberpageNumberprotected voidcheckSignatureFieldAgainstPageDimensions(AnnotationBox signatureFieldBox, AnnotationBox pageBox) This method verifies whether thesignatureFieldBoxis withinpageBoxprotected voidcheckSignatureFieldBoxOverlap(AnnotationBox signatureFieldBox, List<PdfAnnotation> pdfAnnotations) This method verifies whether thesignatureFieldBoxoverlaps with one of the extractedpdfAnnotationsvoidsetAlertOnDocumentReadException(StatusAlert alertOnDocumentReadException) Sets a behavior to follow when aIOExceptionis thrown on an attempt to read document properties Default : ExceptionOnStatusAlert - throw the exceptionvoidsetAlertOnSignatureFieldOutsidePageDimensions(StatusAlert alertOnSignatureFieldOutsidePageDimensions) Sets a behavior to follow when a new signature field is created outside the page's dimensions Default : ExceptionOnStatusAlert - throw the exceptionvoidsetAlertOnSignatureFieldOverlap(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-StatusAlertto 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-StatusAlertto execute
-
setAlertOnDocumentReadException
Sets a behavior to follow when aIOExceptionis thrown on an attempt to read document properties Default : ExceptionOnStatusAlert - throw the exception- Parameters:
alertOnDocumentReadException-StatusAlertto execute
-
assertSignatureFieldPositionValid
public void assertSignatureFieldPositionValid(PdfDocumentReader documentReader, AnnotationBox annotationBox, int pageNumber) This method verifies whetherannotationBoxcan be placed withindocumentReaderon the page numberpageNumber- Parameters:
documentReader-PdfDocumentReaderdocument to create new signature field inannotationBox-AnnotationBoxrepresenting 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 thesignatureFieldBoxoverlaps with one of the extractedpdfAnnotations- Parameters:
signatureFieldBox-AnnotationBoxto verifypdfAnnotations- a list ofAnnotationBoxto verify against
-
checkSignatureFieldAgainstPageDimensions
protected void checkSignatureFieldAgainstPageDimensions(AnnotationBox signatureFieldBox, AnnotationBox pageBox) This method verifies whether thesignatureFieldBoxis withinpageBox- Parameters:
signatureFieldBox-AnnotationBoxto checkpageBox-AnnotationBoxrepresenting the page's box
-