Comparer.Compare
Compare(string, string, string, string, DateTime, CompareOptions)
Compares the document with another document producing changes as number of edit and format revisions.
public static void Compare(string v1, string v2, string outputFileName, string author,
DateTime dateTime, CompareOptions compareOptions = null)
Parameter | Type | Description |
---|---|---|
v1 | String | The original document. |
v2 | String | The modified document. |
outputFileName | String | The output file name. |
author | String | Initials of the author to use for revisions. |
dateTime | DateTime | The date and time to use for revisions. |
compareOptions | CompareOptions | Document comparison options. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
Examples
Demonstrates how to compare two documents.
Comparer.Compare(MyDir + "CompareV1.docx", MyDir + "CompareV2.docx", ArtifactsDir + "Compare.docx", "Wordize", DateTime.Now);
See Also
- class CompareOptions
- class Comparer
- namespace Wordize.Comparing
- assembly Wordize
Compare(string, string, string, SaveFormat, string, DateTime, CompareOptions)
Compares the document with another document producing changes as number of edit and format revisions.
public static void Compare(string v1, string v2, string outputFileName, SaveFormat saveFormat,
string author, DateTime dateTime, CompareOptions compareOptions = null)
Parameter | Type | Description |
---|---|---|
v1 | String | The original document. |
v2 | String | The modified document. |
outputFileName | String | The output file name. |
saveFormat | SaveFormat | The output’s save format. |
author | String | Initials of the author to use for revisions. |
dateTime | DateTime | The date and time to use for revisions. |
compareOptions | CompareOptions | Document comparison options. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
Examples
Demonstrates how to compare two documents with char level granularity.
CompareOptions compareOptions = new CompareOptions() { Granularity = Granularity.CharLevel };
Comparer.Compare(MyDir + "CompareV1.docx", MyDir + "CompareV2.docx", ArtifactsDir + "Compare.Granularity.docx", SaveFormat.Docx, "Wordize", DateTime.Now, compareOptions);
See Also
- enum SaveFormat
- class CompareOptions
- class Comparer
- namespace Wordize.Comparing
- assembly Wordize
Compare(Stream, Stream, Stream, SaveFormat, string, DateTime, CompareOptions)
Compares the document with another document producing changes as number of edit and format revisions.
public static void Compare(Stream v1, Stream v2, Stream outputStream, SaveFormat saveFormat,
string author, DateTime dateTime, CompareOptions compareOptions = null)
Parameter | Type | Description |
---|---|---|
v1 | Stream | The original document. |
v2 | Stream | The modified document. |
outputStream | Stream | The output stream. |
saveFormat | SaveFormat | The output’s save format. |
author | String | Initials of the author to use for revisions. |
dateTime | DateTime | The date and time to use for revisions. |
compareOptions | CompareOptions | Document comparison options. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), only the first page of the output will be saved to the specified stream.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF to the specified stream.
Examples
Demonstrates how to compare two documents from streams using customized CompareOptions.
CompareOptions options = new CompareOptions();
options.IgnoreFormatting = true;
options.IgnoreHeadersAndFooters = true;
using (Stream v1 = File.OpenRead(MyDir + "CompareV1.docx"))
using (Stream v2 = File.OpenRead(MyDir + "CompareV2.docx"))
using (Stream output = File.Create(ArtifactsDir + "CompareStreams.docx"))
{
Comparer.Compare(v1, v2, output, SaveFormat.Docx, "Wordize", DateTime.Now, options);
}
See Also
- enum SaveFormat
- class CompareOptions
- class Comparer
- namespace Wordize.Comparing
- assembly Wordize