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 booleanisAnnotationBoxOverlapping(AnnotationBox annotationBox, List<PdfAnnotation> pdfAnnotations)Checks if the givenannotationBoxoverlaps withotherAnnotations
-
Method Details
-
getAnnotationOverlaps
public static List<PdfModification> getAnnotationOverlaps(PdfDocumentReader reader) throws IOExceptionReturns a list of found annotation overlaps- Parameters:
reader-PdfDocumentReaderthe complete PDF document reader- Returns:
- a list of
PdfModifications - Throws:
IOException- if an exception occurs
-
isAnnotationBoxOverlapping
public static boolean isAnnotationBoxOverlapping(AnnotationBox annotationBox, List<PdfAnnotation> pdfAnnotations)Checks if the givenannotationBoxoverlaps withotherAnnotations- Parameters:
annotationBox-AnnotationBoxto checkpdfAnnotations- a list ofPdfAnnotationto validate against- Returns:
- TRUE when
annotationBoxoverlaps with at least one element fromotherAnnotationslist, 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-PdfDocumentReaderfor the signed (covered) revision contentfinalRevisionReader-PdfDocumentReaderfor the originally provided document- Returns:
- a list of
PdfModifications - 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-PdfDocumentReaderfor the signed (covered) revision contentfinalRevisionReader-PdfDocumentReaderfor the originally provided document- Returns:
- a list of
PdfModifications
-