Class CompareToolResult

java.lang.Object
com.itextpdf.kernel.utils.CompareToolResult

public final class CompareToolResult extends Object
Class containing results of the comparison of two pdf documents.
  • Constructor Details

    • CompareToolResult

      public CompareToolResult (int messageLimit)
      Creates new empty instance of CompareToolResult with given limit of difference messages.
      Parameters:
      messageLimit - maximum number of difference messages to be handled by this CompareToolResult.
  • Method Details

    • isOk

      public boolean isOk()
      Verifies if documents are considered equal after comparison.
      Returns:
      true if documents are equal, false otherwise.
    • getErrorCount

      public int getErrorCount()
      Returns number of differences between two documents detected during comparison.
      Returns:
      number of differences.
    • getReport

      public String getReport()
      Converts this CompareToolResult into text form.
      Returns:
      text report on the differences between two documents.
    • getDifferences

      public Map<ObjectPath,String> getDifferences()
      Returns map with ObjectPath as keys and difference descriptions as values.
      Returns:
      differences map which could be used to find in the document the objects that are different.
    • writeReportToXml

      public void writeReportToXml (OutputStream stream) throws ParserConfigurationException, TransformerException
      Converts this CompareToolResult into xml form.
      Parameters:
      stream - output stream to which xml report will be written.
      Throws:
      ParserConfigurationException - if a XML DocumentBuilder cannot be created which satisfies the configuration requested.
      TransformerException - if it is not possible to create an XML Transformer instance or an unrecoverable error occurs during the course of the transformation.