Skip to content

Commit 17c0008

Browse files
Updated documents and folder comparison examples
1 parent bc70cef commit 17c0008

6 files changed

Lines changed: 305 additions & 289 deletions

File tree

content/english/net/documents-and-folder-comparison/_index.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ url: /net/documents-and-folder-comparison/
1010

1111
## Documents and Folder Comparison Tutorials
1212
### [Accept and Reject Changes in GroupDocs Comparison for .NET](./accept-reject-changes-dotnet/)
13+
Learn how to accept and reject changes in documents using GroupDocs Comparison for .NET. Streamline your document workflows effortlessly.
1314
### [Compare Documents Settings in GroupDocs Comparison for .NET](./compare-documents-settings-dotnet/)
15+
Streamline document comparison in .NET applications with GroupDocs Comparison. Compare documents effortlessly with advanced features.
1416
### [Compare Folders in GroupDocs Comparison for .NET](./compare-folders-dotnet/)
17+
Compare folders effortlessly using GroupDocs Comparison for .NET. Follow our step-by-step for efficient folder comparison. Enhance your .NET applications.
1518
### [Compare Multiple Documents in GroupDocs Comparison for .NET](./compare-multiple-documents-dotnet/)
16-
### [Compare Multiple Documents Settings in GroupDocs Comparison for .NET](./compare-multiple-documents-settings-dotnet/)
19+
Learn how to compare multiple documents efficiently using GroupDocs Comparison for .NET. Follow our step-by-step guide for seamless integration.
20+
### [Compare Multiple Documents Settings in GroupDocs Comparison for .NET](./compare-multiple-documents-settings-dotnet/)
21+
Discover how to compare multiple documents effortlessly using GroupDocs Comparison for .NET. Follow our step-by-step guide for seamless document processing.

content/english/net/documents-and-folder-comparison/accept-reject-changes-dotnet/_index.md

Lines changed: 53 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,66 @@
22
title: Accept and Reject Changes in GroupDocs Comparison for .NET
33
linktitle: Accept and Reject Changes in GroupDocs Comparison for .NET
44
second_title: GroupDocs.Comparison .NET API
5-
description:
5+
description: Learn how to accept and reject changes in documents using GroupDocs Comparison for .NET. Streamline your document workflows effortlessly.
66
type: docs
77
weight: 10
88
url: /net/documents-and-folder-comparison/accept-reject-changes-dotnet/
99
---
10+
## Introduction
11+
In the realm of document management and collaboration, ensuring the accuracy and integrity of files is paramount. GroupDocs Comparison for .NET emerges as a robust solution, empowering developers to effortlessly accept and reject changes within documents, thereby streamlining workflows and enhancing productivity. This tutorial will guide you through the process of accepting and rejecting changes using GroupDocs Comparison for .NET, breaking down each step for clarity and ease of implementation.
12+
## Prerequisites
13+
Before diving into the tutorial, ensure you have the following prerequisites in place:
14+
### Environment Setup
15+
1. Install .NET SDK: If you haven't already, download and install the .NET SDK suitable for your operating system from the .NET website.
16+
2. Install GroupDocs Comparison for .NET: Obtain the latest version of GroupDocs Comparison for .NET from the provided [download link](https://releases.groupdocs.com/comparison/net/) and follow the installation instructions.
17+
3. Familiarity with C# Programming: This tutorial assumes a basic understanding of C# programming language and its syntax.
18+
19+
## Import Namespaces
20+
To begin with, import the necessary namespaces into your project. These namespaces will provide access to the functionalities required for document comparison and manipulation.
1021

11-
## Complete Source Code
1222
```csharp
1323
using System;
1424
using System.IO;
15-
16-
namespace GroupDocs.Comparison.Examples.CSharp.AdvancedUsage
25+
using GroupDocs.Comparison;
26+
using GroupDocs.Comparison.Result;
27+
using GroupDocs.Comparison.Options;
28+
```
29+
## Step 1: Specify Output Directory and File Names
30+
```csharp
31+
string outputDirectory = "Your Document Directory";
32+
string outputFileNameWithAcceptedChange = Path.Combine(outputDirectory, "RESULT_WITH_ACCEPTED_CHANGE.docx");
33+
string outputFileNameWithRejectedChange = Path.Combine(outputDirectory, "RESULT_WITH_REJECTED_CHANGE.docx");
34+
```
35+
Ensure to replace `"Your Document Directory"` with the path to your desired output directory.
36+
## Step 2: Initialize Comparer and Compare Documents
37+
```csharp
38+
using (Comparer comparer = new Comparer("SOURCE.docx"))
1739
{
18-
using GroupDocs.Comparison;
19-
using GroupDocs.Comparison.Result;
20-
using GroupDocs.Comparison.Options;
21-
22-
/// <summary>
23-
/// This example demonstrates how to update changes from path
24-
/// </summary>
25-
class AcceptRejectDetectedChangesPath
26-
{
27-
public static void Run()
28-
{
29-
Console.WriteLine("\n--------------------------------------------------------------------------------------------------------------------");
30-
Console.WriteLine("[Example Advanced Usage] # AcceptRejectDetectedChangesPath : How to update changes from path\n");
31-
32-
string outputDirectory = "Your Document Directory";
33-
string outputFileNameWithAcceptedChange = Path.Combine(outputDirectory, "RESULT_WITH_ACCEPTED_CHANGE.docx");
34-
string outputFileNameWithRejectedChange = Path.Combine(outputDirectory, "RESULT_WITH_REJECTED_CHANGE.docx");
35-
36-
using (Comparer comparer = new Comparer("SOURCE.docx"))
37-
{
38-
comparer.Add("TARGET.docx");
39-
comparer.Compare();
40-
ChangeInfo[] changes = comparer.GetChanges();
41-
// inserted word "Cool" was not be added to result document
42-
changes[0].ComparisonAction = ComparisonAction.Reject;
43-
comparer.ApplyChanges(outputFileNameWithRejectedChange, new ApplyChangeOptions { Changes = changes, SaveOriginalState = true });
44-
changes = comparer.GetChanges();
45-
changes[0].ComparisonAction = ComparisonAction.Accept;
46-
comparer.ApplyChanges(outputFileNameWithAcceptedChange, new ApplyChangeOptions { Changes = changes });
47-
}
48-
Console.WriteLine($"\nChanges updated successfully.\nCheck output in {outputDirectory}.");
49-
}
50-
}
51-
}
52-
40+
comparer.Add("TARGET.docx");
41+
comparer.Compare();
5342
```
43+
This code initializes the Comparer object with the source document and adds the target document for comparison. Then, it executes the comparison process.
44+
## Step 3: Retrieve and Manipulate Changes
45+
```csharp
46+
ChangeInfo[] changes = comparer.GetChanges();
47+
changes[0].ComparisonAction = ComparisonAction.Reject;
48+
comparer.ApplyChanges(outputFileNameWithRejectedChange, new ApplyChangeOptions { Changes = changes, SaveOriginalState = true });
49+
changes = comparer.GetChanges();
50+
changes[0].ComparisonAction = ComparisonAction.Accept;
51+
comparer.ApplyChanges(outputFileNameWithAcceptedChange, new ApplyChangeOptions { Changes = changes });
52+
```
53+
Retrieve the changes from the comparison and manipulate them as needed. In this example, changes are rejected first and then accepted. The resulting documents are saved accordingly.
54+
55+
## Conclusion
56+
In conclusion, GroupDocs Comparison for .NET offers a seamless solution for accepting and rejecting changes within documents. By following the steps outlined in this tutorial, developers can efficiently integrate this functionality into their applications, ensuring document accuracy and enhancing collaboration.
57+
## FAQ's
58+
### Can GroupDocs Comparison for .NET compare documents of different formats?
59+
Yes, GroupDocs Comparison for .NET supports comparison between documents of various formats such as DOCX, PDF, PPTX, and more.
60+
### Is GroupDocs Comparison for .NET compatible with .NET Core?
61+
Yes, GroupDocs Comparison for .NET is compatible with both .NET Framework and .NET Core.
62+
### Can I customize the appearance of changes in the compared documents?
63+
Absolutely, GroupDocs Comparison for .NET provides extensive options for customizing the appearance of changes including color, style, and more.
64+
### Does GroupDocs Comparison for .NET support multi-page document comparison?
65+
Yes, GroupDocs Comparison for .NET supports comparison of multi-page documents with precision and accuracy.
66+
### Is there a trial version available for GroupDocs Comparison for .NET?
67+
Yes, you can avail a free trial of GroupDocs Comparison for .NET from the provided [link](https://releases.groupdocs.com/).

content/english/net/documents-and-folder-comparison/compare-documents-settings-dotnet/_index.md

Lines changed: 68 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,85 @@
22
title: Compare Documents Settings in GroupDocs Comparison for .NET
33
linktitle: Compare Documents Settings in GroupDocs Comparison for .NET
44
second_title: GroupDocs.Comparison .NET API
5-
description:
5+
description: Streamline document comparison in .NET applications with GroupDocs Comparison. Compare documents effortlessly with advanced features.
66
type: docs
77
weight: 11
88
url: /net/documents-and-folder-comparison/compare-documents-settings-dotnet/
99
---
10+
## Introduction
11+
In the realm of document management and comparison, GroupDocs Comparison for .NET stands out as a powerful tool, empowering developers to seamlessly integrate document comparison functionalities into their .NET applications. With its robust features and ease of use, GroupDocs Comparison for .NET simplifies the process of comparing documents, ensuring accuracy and efficiency.
12+
## Prerequisites
13+
Before diving into the intricacies of utilizing GroupDocs Comparison for .NET, it's essential to have a few prerequisites in place:
14+
### 1. Installing GroupDocs Comparison for .NET
15+
Ensure that you have installed GroupDocs Comparison for .NET in your development environment. You can download the necessary files from the [download link](https://releases.groupdocs.com/comparison/net/).
16+
### 2. Setting Up Your Development Environment
17+
Make sure your development environment is properly configured for .NET development. This includes having the appropriate version of the .NET framework installed.
18+
### 3. Acquiring a License
19+
To unlock the full potential of GroupDocs Comparison for .NET, you'll need a valid license. You can obtain one from the [purchase page](https://purchase.groupdocs.com/buy) or utilize a temporary license from [here](https://purchase.groupdocs.com/temporary-license/).
20+
### 4. Familiarity with C# Programming
21+
Since GroupDocs Comparison for .NET is primarily utilized within C# applications, a basic understanding of C# programming is beneficial.
1022

11-
## Complete Source Code
23+
## Import Namespaces
24+
Before proceeding with document comparison using GroupDocs Comparison for .NET, ensure you have imported the necessary namespaces:
1225
```csharp
1326
using System;
1427
using System.IO;
15-
16-
namespace GroupDocs.Comparison.Examples.CSharp.BasicUsage
28+
using GroupDocs.Comparison;
29+
using GroupDocs.Comparison.Options;
30+
```
31+
## Step 1: Define Output Directory and Filename
32+
First, define the directory where you want the compared document to be saved and specify the output filename.
33+
```csharp
34+
string outputDirectory = "Your Document Directory";
35+
string outputFileName = Path.Combine(outputDirectory, "RESULT.docx");
36+
```
37+
## Step 2: Initialize Comparer Object
38+
Create an instance of the `Comparer` class by passing the source document (the document against which comparisons will be made).
39+
```csharp
40+
using (Comparer comparer = new Comparer(File.OpenRead("SOURCE.docx")))
1741
{
18-
using GroupDocs.Comparison;
19-
using GroupDocs.Comparison.Options;
20-
21-
/// <summary>
22-
/// This example demonstrates using some of compare settings
23-
/// </summary>
24-
class CompareDocumentsSettingsStream
42+
}
43+
```
44+
## Step 3: Add Target Document
45+
Add the target document (the document that will be compared against the source document) using the `Add` method.
46+
```csharp
47+
comparer.Add(File.OpenRead("TARGET.docx"));
48+
```
49+
## Step 4: Configure Comparison Options
50+
Specify the comparison options such as the style settings for inserted items using the `CompareOptions` class.
51+
```csharp
52+
CompareOptions compareOptions = new CompareOptions()
2553
{
26-
public static void Run()
54+
InsertedItemStyle = new StyleSettings()
2755
{
28-
Console.WriteLine("\n--------------------------------------------------------------------------------------------------------------------");
29-
Console.WriteLine("[Example Advanced Usage] # CompareDocumentsSettingsStream : Using some of compare settings\n");
30-
31-
string outputDirectory = "Your Document Directory";
32-
string outputFileName = Path.Combine(outputDirectory, "RESULT.docx");
33-
34-
using (Comparer comparer = new Comparer(File.OpenRead("SOURCE.docx")))
35-
{
36-
comparer.Add(File.OpenRead("TARGET.docx"));
37-
CompareOptions compareOptions = new CompareOptions()
38-
{
39-
InsertedItemStyle = new StyleSettings()
40-
{
41-
HighlightColor = System.Drawing.Color.Red,
42-
FontColor = System.Drawing.Color.Green,
43-
IsUnderline = true
44-
}
45-
};
46-
comparer.Compare(File.Create(outputFileName), compareOptions);
47-
}
48-
Console.WriteLine($"\nDocuments compared successfully.\nCheck output in {Directory.GetCurrentDirectory()}.");
56+
HighlightColor = System.Drawing.Color.Red,
57+
FontColor = System.Drawing.Color.Green,
58+
IsUnderline = true
4959
}
50-
}
60+
};
61+
```
62+
## Step 5: Perform Comparison
63+
Perform the document comparison using the `Compare` method, passing the output file stream and the comparison options.
64+
```csharp
65+
comparer.Compare(File.Create(outputFileName), compareOptions);
66+
```
67+
## Step 6: Display Result
68+
Notify the user that the documents have been compared successfully and provide the location of the output file.
69+
```csharp
70+
Console.WriteLine($"\nDocuments compared successfully.\nCheck output in {Directory.GetCurrentDirectory()}.");
5171
}
52-
5372
```
73+
74+
## Conclusion
75+
In conclusion, GroupDocs Comparison for .NET offers a comprehensive solution for document comparison within .NET applications. By following the step-by-step guide outlined above and leveraging the powerful features of GroupDocs Comparison for .NET, developers can streamline the document comparison process with ease and precision.
76+
## FAQ's
77+
### Q: Can I compare documents of different formats using GroupDocs Comparison for .NET?
78+
Yes, GroupDocs Comparison for .NET supports comparing documents of various formats including DOCX, PDF, PPTX, and more.
79+
### Q: Is there a trial version available for GroupDocs Comparison for .NET?
80+
Yes, you can avail of a free trial from [here](https://releases.groupdocs.com/).
81+
### Q: How can I get technical support for GroupDocs Comparison for .NET?
82+
You can seek technical support from the [support forum](https://forum.groupdocs.com/c/comparison/12).
83+
### Q: Can I customize the style settings for compared documents?
84+
Yes, you can customize the style settings such as highlight color, font color, and underline using the `StyleSettings` class.
85+
### Q: Is GroupDocs Comparison for .NET suitable for enterprise-level applications?
86+
Yes, GroupDocs Comparison for .NET is designed to cater to the needs of both small-scale and enterprise-level applications, offering scalability and reliability.

0 commit comments

Comments
 (0)