Comparer

Inheritance: java.lang.Object

public class Comparer

Provides methods intended to compare documents.

Methods

MethodDescription
compare(InputStream v1, InputStream v2, OutputStream outputStream, int saveFormat, String author, Date dateTime)
compare(InputStream v1, InputStream v2, OutputStream outputStream, int saveFormat, String author, Date dateTime, CompareOptions compareOptions)
compare(String v1, String v2, String outputFileName, int saveFormat, String author, Date dateTime)
compare(String v1, String v2, String outputFileName, int saveFormat, String author, Date dateTime, CompareOptions compareOptions)
compare(String v1, String v2, String outputFileName, String author, Date dateTime)Compares two documents and saves the differences to the specified output file, producing changes as a number of edit and format revisions.
compare(String v1, String v2, String outputFileName, String author, Date dateTime, CompareOptions compareOptions)Compares two documents with additional options and saves the differences to the specified output file, producing changes as a number of edit and format revisions.

compare(InputStream v1, InputStream v2, OutputStream outputStream, int saveFormat, String author, Date dateTime)

public static void compare(InputStream v1, InputStream v2, OutputStream outputStream, int saveFormat, String author, Date dateTime)

Parameters:

ParameterTypeDescription
v1java.io.InputStream
v2java.io.InputStream
outputStreamjava.io.OutputStream
saveFormatint
authorjava.lang.String
dateTimejava.util.Date

compare(InputStream v1, InputStream v2, OutputStream outputStream, int saveFormat, String author, Date dateTime, CompareOptions compareOptions)

public static void compare(InputStream v1, InputStream v2, OutputStream outputStream, int saveFormat, String author, Date dateTime, CompareOptions compareOptions)

Parameters:

ParameterTypeDescription
v1java.io.InputStream
v2java.io.InputStream
outputStreamjava.io.OutputStream
saveFormatint
authorjava.lang.String
dateTimejava.util.Date
compareOptionsCompareOptions

compare(String v1, String v2, String outputFileName, int saveFormat, String author, Date dateTime)

public static void compare(String v1, String v2, String outputFileName, int saveFormat, String author, Date dateTime)

Parameters:

ParameterTypeDescription
v1java.lang.String
v2java.lang.String
outputFileNamejava.lang.String
saveFormatint
authorjava.lang.String
dateTimejava.util.Date

compare(String v1, String v2, String outputFileName, int saveFormat, String author, Date dateTime, CompareOptions compareOptions)

public static void compare(String v1, String v2, String outputFileName, int saveFormat, String author, Date dateTime, CompareOptions compareOptions)

Parameters:

ParameterTypeDescription
v1java.lang.String
v2java.lang.String
outputFileNamejava.lang.String
saveFormatint
authorjava.lang.String
dateTimejava.util.Date
compareOptionsCompareOptions

compare(String v1, String v2, String outputFileName, String author, Date dateTime)

public static void compare(String v1, String v2, String outputFileName, String author, Date dateTime)

Compares two documents and saves the differences to the specified output file, producing changes as a number of edit and format revisions.

Examples:

Shows how to simple compare documents.


 // There is a several ways to compare documents:
 String firstDoc = getMyDir() + "Table column bookmarks.docx";
 String secondDoc = getMyDir() + "Table column bookmarks.doc";

 Comparer.compare(firstDoc, secondDoc, getArtifactsDir() + "LowCode.CompareDocuments.1.docx", "Author", new Date());
 Comparer.compare(firstDoc, secondDoc, getArtifactsDir() + "LowCode.CompareDocuments.2.docx", SaveFormat.DOCX, "Author", new Date());
 CompareOptions options = new CompareOptions();
 options.setIgnoreCaseChanges(true);
 Comparer.compare(firstDoc, secondDoc, getArtifactsDir() + "LowCode.CompareDocuments.3.docx", "Author", new Date(), options);
 Comparer.compare(firstDoc, secondDoc, getArtifactsDir() + "LowCode.CompareDocuments.4.docx", SaveFormat.DOCX, "Author", new Date(), options);
 

Parameters:

ParameterTypeDescription
v1java.lang.StringThe original document.
v2java.lang.StringThe modified document.
outputFileNamejava.lang.StringThe output file name.
authorjava.lang.StringInitials of the author to use for revisions.
dateTimejava.util.DateThe date and time to use for revisions.

compare(String v1, String v2, String outputFileName, String author, Date dateTime, CompareOptions compareOptions)

public static void compare(String v1, String v2, String outputFileName, String author, Date dateTime, CompareOptions compareOptions)

Compares two documents with additional options and saves the differences to the specified output file, producing changes as a number of edit and format revisions.

Examples:

Shows how to simple compare documents.


 // There is a several ways to compare documents:
 String firstDoc = getMyDir() + "Table column bookmarks.docx";
 String secondDoc = getMyDir() + "Table column bookmarks.doc";

 Comparer.compare(firstDoc, secondDoc, getArtifactsDir() + "LowCode.CompareDocuments.1.docx", "Author", new Date());
 Comparer.compare(firstDoc, secondDoc, getArtifactsDir() + "LowCode.CompareDocuments.2.docx", SaveFormat.DOCX, "Author", new Date());
 CompareOptions options = new CompareOptions();
 options.setIgnoreCaseChanges(true);
 Comparer.compare(firstDoc, secondDoc, getArtifactsDir() + "LowCode.CompareDocuments.3.docx", "Author", new Date(), options);
 Comparer.compare(firstDoc, secondDoc, getArtifactsDir() + "LowCode.CompareDocuments.4.docx", SaveFormat.DOCX, "Author", new Date(), options);
 

Parameters:

ParameterTypeDescription
v1java.lang.StringThe original document.
v2java.lang.StringThe modified document.
outputFileNamejava.lang.StringThe output file name.
authorjava.lang.StringInitials of the author to use for revisions.
dateTimejava.util.DateThe date and time to use for revisions.
compareOptionsCompareOptionsDocument comparison options.