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
ConstructorDescriptionDefault 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 annotationsboolean
isAnnotationBoxOverlapping
(AnnotationBox annotationBox, List<PdfAnnotation> pdfAnnotations) Checks if the givenannotationBox
overlaps withpdfAnnotations
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
-
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:PdfDifferencesFinder
Returns a list of found annotation overlaps- Specified by:
getAnnotationOverlaps
in interfacePdfDifferencesFinder
- Parameters:
reader
-PdfDocumentReader
the complete PDF document reader- Returns:
- a list of
PdfModification
s
-
isAnnotationBoxOverlapping
public boolean isAnnotationBoxOverlapping(AnnotationBox annotationBox, List<PdfAnnotation> pdfAnnotations) Description copied from interface:PdfDifferencesFinder
Checks if the givenannotationBox
overlaps withpdfAnnotations
- Specified by:
isAnnotationBoxOverlapping
in interfacePdfDifferencesFinder
- Parameters:
annotationBox
-AnnotationBox
to checkpdfAnnotations
- a list ofPdfAnnotation
to validate against- Returns:
- TRUE when
annotationBox
overlaps with at least one element fromotherAnnotations
list, FALSE otherwise
-
getPagesDifferences
public List<PdfModification> getPagesDifferences(PdfDocumentReader signedRevisionReader, PdfDocumentReader finalRevisionReader) Description copied from interface:PdfDifferencesFinder
Returns a list of missing/added pages between signed and final revisions- Specified by:
getPagesDifferences
in interfacePdfDifferencesFinder
- Parameters:
signedRevisionReader
-PdfDocumentReader
for the signed (covered) revision contentfinalRevisionReader
-PdfDocumentReader
for the originally provided document- Returns:
- a list of
PdfModification
s
-
getVisualDifferences
public List<PdfModification> getVisualDifferences(PdfDocumentReader signedRevisionReader, PdfDocumentReader finalRevisionReader) Description copied from interface:PdfDifferencesFinder
Returns a list of visual differences found between signed and final revisions excluding newly created annotations- Specified by:
getVisualDifferences
in interfacePdfDifferencesFinder
- Parameters:
signedRevisionReader
-PdfDocumentReader
for the signed (covered) revision contentfinalRevisionReader
-PdfDocumentReader
for the originally provided document- Returns:
- a list of
PdfModification
s
-