Comparer
Inheritance: java.lang.Object
public class Comparer
Provides methods intended to compare documents.
Methods
Method | Description |
---|---|
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:
Parameter | Type | Description |
---|---|---|
v1 | java.io.InputStream | |
v2 | java.io.InputStream | |
outputStream | java.io.OutputStream | |
saveFormat | int | |
author | java.lang.String | |
dateTime | java.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:
Parameter | Type | Description |
---|---|---|
v1 | java.io.InputStream | |
v2 | java.io.InputStream | |
outputStream | java.io.OutputStream | |
saveFormat | int | |
author | java.lang.String | |
dateTime | java.util.Date | |
compareOptions | CompareOptions |
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:
Parameter | Type | Description |
---|---|---|
v1 | java.lang.String | |
v2 | java.lang.String | |
outputFileName | java.lang.String | |
saveFormat | int | |
author | java.lang.String | |
dateTime | java.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:
Parameter | Type | Description |
---|---|---|
v1 | java.lang.String | |
v2 | java.lang.String | |
outputFileName | java.lang.String | |
saveFormat | int | |
author | java.lang.String | |
dateTime | java.util.Date | |
compareOptions | CompareOptions |
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:
Parameter | Type | Description |
---|---|---|
v1 | java.lang.String | The original document. |
v2 | java.lang.String | The modified document. |
outputFileName | java.lang.String | The output file name. |
author | java.lang.String | Initials of the author to use for revisions. |
dateTime | java.util.Date | The 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:
Parameter | Type | Description |
---|---|---|
v1 | java.lang.String | The original document. |
v2 | java.lang.String | The modified document. |
outputFileName | java.lang.String | The output file name. |
author | java.lang.String | Initials of the author to use for revisions. |
dateTime | java.util.Date | The date and time to use for revisions. |
compareOptions | CompareOptions | Document comparison options. |