Class PdfComparer


  • public class PdfComparer
    extends java.lang.Object
    Utility class with static methods to compare pdf files
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean compare​(java.lang.String pdf1, java.lang.String pdf2)
      Method to compare two pdf files with default resolution in dpi = 300
      static boolean compare​(java.lang.String pdf1, java.lang.String pdf2, float resolutionInDpi)
      Method to compare two pdf files
      static boolean compare​(java.lang.String pdf1, java.lang.String pdf2, float resolutionInDpi, int x, int y, int width, int height)
      Method to compare two pdf files
      static boolean compare​(java.lang.String pdf1, java.lang.String pdf2, int x, int y, int width, int height)
      Method to compare two pdf files with default resolution in dpi = 300
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • compare

        public static boolean compare​(java.lang.String pdf1,
                                      java.lang.String pdf2,
                                      float resolutionInDpi,
                                      int x,
                                      int y,
                                      int width,
                                      int height)
                               throws java.io.IOException
        Method to compare two pdf files
        Parameters:
        pdf1 - string pdf file path
        pdf2 - string pdf file path
        resolutionInDpi - float between 96 and 1000
        x - int startX
        y - int startY
        width - width (value 1 meaning use max possible size)
        height - height (value 1 meaning use max possible size)
        Returns:
        return true if pdf files are equal
        Throws:
        java.io.IOException
      • compare

        public static boolean compare​(java.lang.String pdf1,
                                      java.lang.String pdf2)
                               throws java.io.IOException
        Method to compare two pdf files with default resolution in dpi = 300
        Parameters:
        pdf1 - the first pdf file path
        pdf2 - the second pdf file path
        Returns:
        return true if pdf files are equal
        Throws:
        java.io.IOException
      • compare

        public static boolean compare​(java.lang.String pdf1,
                                      java.lang.String pdf2,
                                      float resolutionInDpi)
                               throws java.io.IOException
        Method to compare two pdf files
        Parameters:
        pdf1 - the first pdf file path
        pdf2 - the second pdf file path
        resolutionInDpi - float between 96 and 1000
        Returns:
        return true if pdf files are equal
        Throws:
        java.io.IOException
      • compare

        public static boolean compare​(java.lang.String pdf1,
                                      java.lang.String pdf2,
                                      int x,
                                      int y,
                                      int width,
                                      int height)
                               throws java.io.IOException
        Method to compare two pdf files with default resolution in dpi = 300
        Parameters:
        pdf1 - the first pdf file path
        pdf2 - the second pdf file path
        x - int startX
        y - int startY
        width - width (value 1 meaning use max possible size)
        height - height (value 1 meaning use max possible size)
        Returns:
        return true if pdf files are equal
        Throws:
        java.io.IOException