Class DefaultPdfDifferencesFinder
java.lang.Object
eu.europa.esig.dss.pdf.modifications.DefaultPdfDifferencesFinder
- All Implemented Interfaces:
PdfDifferencesFinder
Default implementation used to find differences in pages between two PDF revisions.
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor instantiating object with default configuration -
Method Summary
Modifier and TypeMethodDescriptionReturns a list of found annotation overlapsgetPagesDifferences(PdfDocumentReader signedRevisionReader, PdfDocumentReader finalRevisionReader) Returns a list of missing/added pages between signed and final revisionsgetVisualDifferences(PdfDocumentReader signedRevisionReader, PdfDocumentReader finalRevisionReader) Returns a list of visual differences found between signed and final revisions excluding newly created annotationsbooleanisAnnotationBoxOverlapping(AnnotationBox annotationBox, List<PdfAnnotation> pdfAnnotations) Checks if the givenannotationBoxoverlaps withpdfAnnotationsvoidsetMaximalPagesAmountForVisualComparison(int pagesAmount) Sets a maximal pages amount in a PDF to process a visual screenshot comparison Example: for value 10, the visual comparison will be executed for a PDF containing 10 and fewer pages NOTE: In order to disable visual comparison check set the pages amount to 0 (zero) Default : 10 pages
-
Constructor Details
-
DefaultPdfDifferencesFinder
public DefaultPdfDifferencesFinder()Default constructor instantiating object with default configuration
-
-
Method Details
-
setMaximalPagesAmountForVisualComparison
public void setMaximalPagesAmountForVisualComparison(int pagesAmount) Sets a maximal pages amount in a PDF to process a visual screenshot comparison Example: for value 10, the visual comparison will be executed for a PDF containing 10 and fewer pages NOTE: In order to disable visual comparison check set the pages amount to 0 (zero) Default : 10 pages- Parameters:
pagesAmount- the amount of the pages to execute visual comparison for
-
getAnnotationOverlaps
Description copied from interface:PdfDifferencesFinderReturns a list of found annotation overlaps- Specified by:
getAnnotationOverlapsin interfacePdfDifferencesFinder- Parameters:
reader-PdfDocumentReaderthe complete PDF document reader- Returns:
- a list of
PdfModifications
-
isAnnotationBoxOverlapping
public boolean isAnnotationBoxOverlapping(AnnotationBox annotationBox, List<PdfAnnotation> pdfAnnotations) Description copied from interface:PdfDifferencesFinderChecks if the givenannotationBoxoverlaps withpdfAnnotations- Specified by:
isAnnotationBoxOverlappingin interfacePdfDifferencesFinder- Parameters:
annotationBox-AnnotationBoxto checkpdfAnnotations- a list ofPdfAnnotationto validate against- Returns:
- TRUE when
annotationBoxoverlaps with at least one element fromotherAnnotationslist, FALSE otherwise
-
getPagesDifferences
public List<PdfModification> getPagesDifferences(PdfDocumentReader signedRevisionReader, PdfDocumentReader finalRevisionReader) Description copied from interface:PdfDifferencesFinderReturns a list of missing/added pages between signed and final revisions- Specified by:
getPagesDifferencesin interfacePdfDifferencesFinder- Parameters:
signedRevisionReader-PdfDocumentReaderfor the signed (covered) revision contentfinalRevisionReader-PdfDocumentReaderfor the originally provided document- Returns:
- a list of
PdfModifications
-
getVisualDifferences
public List<PdfModification> getVisualDifferences(PdfDocumentReader signedRevisionReader, PdfDocumentReader finalRevisionReader) Description copied from interface:PdfDifferencesFinderReturns a list of visual differences found between signed and final revisions excluding newly created annotations- Specified by:
getVisualDifferencesin interfacePdfDifferencesFinder- Parameters:
signedRevisionReader-PdfDocumentReaderfor the signed (covered) revision contentfinalRevisionReader-PdfDocumentReaderfor the originally provided document- Returns:
- a list of
PdfModifications
-