Package eu.europa.esig.dss.pdf
Class PdfModificationDetectionUtils
java.lang.Object
eu.europa.esig.dss.pdf.PdfModificationDetectionUtils
public class PdfModificationDetectionUtils extends Object
The class contains utils for modification detection
-
Method Summary
Modifier and Type Method Description static List<PdfModification>
getAnnotationOverlaps(PdfDocumentReader reader)
Returns a list of found annotation overlapsstatic List<PdfModification>
getPagesDifferences(PdfDocumentReader signedRevisionReader, PdfDocumentReader finalRevisionReader)
Returns a list of missing/added pages between signed and final revisionsstatic List<PdfModification>
getVisualDifferences(PdfDocumentReader signedRevisionReader, PdfDocumentReader finalRevisionReader)
Returns a list of visual differences found between signed and final revisions excluding newly created annotationsstatic boolean
isAnnotationBoxOverlapping(AnnotationBox annotationBox, List<PdfAnnotation> pdfAnnotations)
Checks if the givenannotationBox
overlaps withotherAnnotations
-
Method Details
-
getAnnotationOverlaps
public static List<PdfModification> getAnnotationOverlaps(PdfDocumentReader reader) throws IOExceptionReturns a list of found annotation overlaps- Parameters:
reader
-PdfDocumentReader
the complete PDF document reader- Returns:
- a list of
PdfModification
s - Throws:
IOException
- if an exception occurs
-
isAnnotationBoxOverlapping
public static boolean isAnnotationBoxOverlapping(AnnotationBox annotationBox, List<PdfAnnotation> pdfAnnotations)Checks if the givenannotationBox
overlaps withotherAnnotations
- 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
-
getVisualDifferences
public static List<PdfModification> getVisualDifferences(PdfDocumentReader signedRevisionReader, PdfDocumentReader finalRevisionReader) throws IOExceptionReturns a list of visual differences found between signed and final revisions excluding newly created annotations- Parameters:
signedRevisionReader
-PdfDocumentReader
for the signed (covered) revision contentfinalRevisionReader
-PdfDocumentReader
for the originally provided document- Returns:
- a list of
PdfModification
s - Throws:
IOException
- if an exception occurs
-
getPagesDifferences
public static List<PdfModification> getPagesDifferences(PdfDocumentReader signedRevisionReader, PdfDocumentReader finalRevisionReader)Returns a list of missing/added pages between signed and final revisions- Parameters:
signedRevisionReader
-PdfDocumentReader
for the signed (covered) revision contentfinalRevisionReader
-PdfDocumentReader
for the originally provided document- Returns:
- a list of
PdfModification
s
-