Skip to content

Commit 87399cb

Browse files
Updated loading and saving docs examples
1 parent e16b453 commit 87399cb

9 files changed

Lines changed: 429 additions & 261 deletions

File tree

content/english/net/loading-and-saving-documents/_index.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,18 @@ url: /net/loading-and-saving-documents/
1010

1111
## Loading and Saving Documents Tutorials
1212
### [Loading Documents in GroupDocs Comparison for .NET](./loading-documents/)
13+
Learn how to compare documents efficiently using GroupDocs.Comparison for .NET. Streamline your document management processes.
1314
### [Loading Documents from Stream in GroupDocs Comparison for .NET](./loading-documents-from-stream/)
15+
Learn how to effortlessly compare documents in .NET applications using GroupDocs Comparison, a powerful .NET library.
1416
### [Loading Text from String in GroupDocs Comparison for .NET](./loading-text-from-string/)
17+
Effortlessly compare text within .NET applications using GroupDocs.Comparison library. Enhance efficiency and accuracy with seamless integration.
1518
### [Using Load Options in GroupDocs Comparison for .NET](./using-load-options/)
19+
Learn how to use Load Options in GroupDocs Comparison for .NET to compare documents with custom fonts seamlessly.
1620
### [Saving Documents Metadata Source in GroupDocs Comparison for .NET](./saving-documents-metadata-source/)
21+
Learn how to save document metadata source using GroupDocs Comparison for .NET. Follow our step-by-step guide for seamless document comparison in your .NET.
1722
### [Saving Documents Metadata Target in GroupDocs Comparison for .NET](./saving-documents-metadata-target/)
23+
Learn how to save documents metadata target using GroupDocs Comparison for .NET. Easy steps for efficient document comparison in your .NET applications.
1824
### [Saving User Defined Document Metadata in GroupDocs Comparison for .NET](./saving-user-defined-document-metadata/)
19-
### [Setting Password for Resultant Document in GroupDocs Comparison for .NET](./setting-password-for-resultant-document/)
25+
Learn how to save user-defined document metadata using GroupDocs Comparison for .NET. Easily compare and manipulate metadata with step-by-step instructions.
26+
### [Setting Password for Resultant Document in GroupDocs Comparison for .NET](./setting-password-for-resultant-document/)
27+
Learn how to set a password for resultant documents in GroupDocs Comparison for .NET. Enhance security and protect your compared files.

content/english/net/loading-and-saving-documents/loading-documents-from-stream/_index.md

Lines changed: 54 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,68 @@
22
title: Loading Documents from Stream in GroupDocs Comparison for .NET
33
linktitle: Loading Documents from Stream in GroupDocs Comparison for .NET
44
second_title: GroupDocs.Comparison .NET API
5-
description:
5+
description: Learn how to effortlessly compare documents in .NET applications using GroupDocs Comparison, a powerful .NET library.
66
type: docs
77
weight: 11
88
url: /net/loading-and-saving-documents/loading-documents-from-stream/
99
---
10+
## Introduction
11+
In the realm of document management and comparison tools, GroupDocs Comparison for .NET stands out as a robust solution tailored for .NET developers. This powerful library empowers developers to seamlessly integrate document comparison functionality into their .NET applications. Whether you're working on a content management system, a legal application, or any other project requiring document analysis and comparison, GroupDocs Comparison for .NET is a reliable ally.
12+
## Prerequisites
13+
Before delving into the intricacies of using GroupDocs Comparison for .NET, ensure you have the following prerequisites in place:
14+
1. Installation of GroupDocs Comparison for .NET: Begin by downloading and installing GroupDocs Comparison for .NET library. You can obtain the library from the [download link](https://releases.groupdocs.com/comparison/net/). Follow the installation instructions provided in the documentation.
15+
2. Basic Understanding of .NET Framework: Familiarize yourself with the .NET framework, particularly C#. Since GroupDocs Comparison for .NET is primarily targeted at .NET developers, a foundational understanding of .NET development is essential.
16+
3. Integrated Development Environment (IDE): Choose an IDE of your preference for .NET development. Popular choices include Visual Studio, Visual Studio Code, and JetBrains Rider.
17+
4. Document Files: Prepare the source and target documents that you intend to compare. Ensure they are accessible within your project directory.
1018

11-
## Complete Source Code
19+
## Import Namespaces
20+
Before diving into the code, ensure you import the necessary namespaces to access the functionality of GroupDocs Comparison for .NET:
1221
```csharp
1322
using System;
1423
using System.IO;
15-
16-
namespace GroupDocs.Comparison.Examples.CSharp.AdvancedUsage.Loading
24+
```
25+
## Step 1: Define Output Directory and File Name
26+
Firstly, set the directory where you want to save the compared document and specify the output file name.
27+
```csharp
28+
string outputDirectory = "Your Document Directory";
29+
string outputFileName = Path.Combine(outputDirectory, "RESULT.docx");
30+
```
31+
## Step 2: Open Source and Target Document Streams
32+
Open streams for both the source and target documents you want to compare. Replace `"SOURCE.docx"` and `"TARGET.docx"` with the paths to your source and target documents respectively.
33+
```csharp
34+
using (Stream sourceStream = File.OpenRead("SOURCE.docx"))
35+
using (Stream targetStream = File.OpenRead("TARGET.docx"))
1736
{
18-
/// <summary>
19-
/// This example demonstrates comparing of two documents loaded by file stream
20-
/// </summary>
21-
class LoadDocumentFromStream
22-
{
23-
public static void Run()
24-
{
25-
Console.WriteLine("\n--------------------------------------------------------------------------------------------------------------------");
26-
Console.WriteLine("[Example Advanced Usage] # LoadDocumentFromStream : comparing of two documents loaded by file stream\n");
27-
28-
string outputDirectory = "Your Document Directory";
29-
string outputFileName = Path.Combine(outputDirectory, "RESULT.docx");
30-
31-
using (Stream sourceStream = File.OpenRead("SOURCE.docx"))
32-
using (Stream targetStream = File.OpenRead("TARGET.docx"))
33-
{
34-
using (Comparer comparer = new Comparer(sourceStream))
35-
{
36-
comparer.Add(targetStream);
37-
comparer.Compare(File.Create(outputFileName));
38-
}
39-
}
40-
Console.WriteLine($"\nDocuments compared successfully.\nCheck output in {outputDirectory}.");
41-
}
42-
}
37+
```
38+
## Step 3: Initialize Comparer and Add Documents
39+
Create an instance of the `Comparer` class and add the target document for comparison using the `Add` method.
40+
```csharp
41+
using (Comparer comparer = new Comparer(sourceStream))
42+
{
43+
comparer.Add(targetStream);
44+
```
45+
## Step 4: Perform Comparison and Save Output
46+
Execute the comparison process and save the compared document to the specified output file using the `Compare` method.
47+
```csharp
48+
comparer.Compare(File.Create(outputFileName));
4349
}
44-
4550
```
51+
## Step 5: Display Success Message
52+
Inform the user that the documents have been compared successfully and provide the path to the output directory.
53+
```csharp
54+
Console.WriteLine($"\nDocuments compared successfully.\nCheck output in {outputDirectory}.");
55+
```
56+
57+
## Conclusion
58+
In this tutorial, we've explored how to utilize GroupDocs Comparison for .NET to compare documents seamlessly within your .NET applications. By following the step-by-step guide, you can efficiently integrate document comparison functionality, enhancing your document management systems or applications.
59+
## FAQ's
60+
### Is GroupDocs Comparison for .NET compatible with various document formats?
61+
Yes, GroupDocs Comparison for .NET supports a wide range of document formats including DOCX, PDF, PPTX, XLSX, and more.
62+
### Can I customize the comparison settings according to my requirements?
63+
Absolutely, GroupDocs Comparison for .NET provides extensive customization options allowing you to tailor the comparison process as per your needs.
64+
### Is there a trial version available for testing before purchasing?
65+
Yes, you can avail a free trial of GroupDocs Comparison for .NET from [here](https://releases.groupdocs.com/).
66+
### Does GroupDocs Comparison for .NET offer technical support?
67+
Yes, you can seek assistance and participate in discussions on the GroupDocs forum [here](https://forum.groupdocs.com/c/comparison/12).
68+
### Can I obtain a temporary license for evaluation purposes?
69+
Certainly, you can acquire a temporary license for evaluation purposes from [here](https://purchase.groupdocs.com/temporary-license/).

content/english/net/loading-and-saving-documents/loading-documents/_index.md

Lines changed: 49 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,64 @@
22
title: Loading Documents in GroupDocs Comparison for .NET
33
linktitle: Loading Documents in GroupDocs Comparison for .NET
44
second_title: GroupDocs.Comparison .NET API
5-
description:
5+
description: Learn how to compare documents efficiently using GroupDocs.Comparison for .NET. Streamline your document management processes.
66
type: docs
77
weight: 10
88
url: /net/loading-and-saving-documents/loading-documents/
99
---
10+
## Introduction
11+
Welcome to our comprehensive tutorial on utilizing GroupDocs.Comparison for .NET! In this tutorial, we will walk you through the process of comparing documents step by step using this powerful tool. GroupDocs.Comparison for .NET offers a robust set of features for document comparison, allowing developers to efficiently compare various document formats such as Word documents, PDFs, Excel spreadsheets, and more.
12+
## Prerequisites
13+
Before we delve into the tutorial, there are a few prerequisites you need to have in place:
14+
### 1. Install GroupDocs.Comparison for .NET
15+
Ensure you have GroupDocs.Comparison for .NET installed in your development environment. You can download the latest version from the [download link](https://releases.groupdocs.com/comparison/net/).
16+
### 2. Get Familiar with .NET Framework
17+
Basic knowledge of the .NET framework and C# programming language is required to follow along with this tutorial.
18+
### 3. Set Up Your Development Environment
19+
Make sure you have a suitable development environment set up, including an integrated development environment (IDE) such as Visual Studio.
20+
21+
## Import Namespaces
22+
Before we begin comparing documents, let's import the necessary namespaces into our project.
1023

11-
## Complete Source Code
1224
```csharp
1325
using System;
1426
using System.IO;
27+
```
1528

16-
namespace GroupDocs.Comparison.Examples.CSharp.AdvancedUsage.Loading
29+
Now that we have set up our environment and imported the required namespaces, let's proceed with loading documents and performing comparisons.
30+
## Step 1: Define Output Directory and File Name
31+
```csharp
32+
string outputDirectory = "Your Document Directory";
33+
string outputFileName = Path.Combine(outputDirectory, "RESULT.docx");
34+
```
35+
## Step 2: Specify Source and Target Documents
36+
```csharp
37+
string sourcePath = "SOURCE.docx";
38+
string targetPath = "TARGET.docx";
39+
```
40+
## Step 3: Perform Document Comparison
41+
```csharp
42+
using (Comparer comparer = new Comparer(sourcePath))
1743
{
18-
/// <summary>
19-
/// This example demonstrates comparing of two documents loaded by file path
20-
/// </summary>
21-
class LoadDocumentFromLocalDisc
22-
{
23-
public static void Run()
24-
{
25-
Console.WriteLine("\n--------------------------------------------------------------------------------------------------------------------");
26-
Console.WriteLine("[Example Advanced Usage] # LoadDocumentFromLocalDisc : comparing of two documents loaded by file path\n");
27-
28-
string outputDirectory = "Your Document Directory";
29-
string outputFileName = Path.Combine(outputDirectory, "RESULT.docx");
30-
31-
string sourcePath = "SOURCE.docx";
32-
using (Comparer comparer = new Comparer(sourcePath))
33-
{
34-
string targetPath = "SOURCE.docx";
35-
comparer.Add("TARGET.docx");
36-
comparer.Compare(outputFileName);
37-
}
38-
Console.WriteLine($"\nDocuments compared successfully.\nCheck output in {outputDirectory}.");
39-
}
40-
}
44+
comparer.Add(targetPath);
45+
comparer.Compare(outputFileName);
4146
}
42-
4347
```
48+
## Step 4: Display Output Location
49+
```csharp
50+
Console.WriteLine($"\nDocuments compared successfully.\nCheck output in {outputDirectory}.");
51+
```
52+
53+
## Conclusion
54+
Congratulations! You've successfully learned how to compare documents using GroupDocs.Comparison for .NET. This powerful tool provides an efficient solution for comparing various document formats, helping you streamline your document management processes.
55+
## FAQ's
56+
### Can I compare documents of different formats using GroupDocs.Comparison for .NET?
57+
Yes, GroupDocs.Comparison for .NET supports comparing documents of different formats, including Word documents, PDFs, Excel spreadsheets, and more.
58+
### Is there a free trial available for GroupDocs.Comparison for .NET?
59+
Yes, you can avail of a free trial of GroupDocs.Comparison for .NET by visiting the [website](https://releases.groupdocs.com/).
60+
### Where can I find documentation for GroupDocs.Comparison for .NET?
61+
You can refer to the comprehensive documentation available at [GroupDocs.Comparison for .NET Documentation](https://reference.groupdocs.com/comparison/net/).
62+
### How can I obtain a temporary license for GroupDocs.Comparison for .NET?
63+
You can obtain a temporary license by visiting the [temporary license page](https://purchase.groupdocs.com/temporary-license/) on the GroupDocs website.
64+
### Where can I seek support for GroupDocs.Comparison for .NET?
65+
For any queries or assistance, you can visit the [GroupDocs.Comparison forum](https://forum.groupdocs.com/c/comparison/12) for support.

content/english/net/loading-and-saving-documents/loading-text-from-string/_index.md

Lines changed: 58 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,70 @@
22
title: Loading Text from String in GroupDocs Comparison for .NET
33
linktitle: Loading Text from String in GroupDocs Comparison for .NET
44
second_title: GroupDocs.Comparison .NET API
5-
description:
5+
description: Effortlessly compare text within .NET applications using GroupDocs.Comparison library. Enhance efficiency and accuracy with seamless integration.
66
type: docs
77
weight: 12
88
url: /net/loading-and-saving-documents/loading-text-from-string/
99
---
10+
## Introduction
11+
In the world of software development, efficiency and accuracy are paramount. Whether you're a seasoned developer or just starting, having the right tools can make all the difference. GroupDocs.Comparison for .NET is one such tool that empowers developers to compare text effortlessly within their .NET applications. This powerful library streamlines the process of text comparison, allowing developers to focus on their core tasks without compromising on quality.
12+
## Prerequisites
13+
Before diving into the intricacies of GroupDocs.Comparison for .NET, ensure you have the following prerequisites in place:
14+
1. Basic Knowledge of .NET Development: Familiarity with C# and .NET framework is essential to grasp the concepts covered in this tutorial.
15+
2. Installation of GroupDocs.Comparison for .NET: Download and install the library from the [release page](https://releases.groupdocs.com/comparison/net/).
16+
3. Text Comparison Scenario: Understand the scenario where text comparison is required within your application.
17+
18+
## Import Namespaces
19+
In order to utilize GroupDocs.Comparison for .NET, you need to import the necessary namespaces. Follow these steps:
1020

11-
## Complete Source Code
1221
```csharp
1322
using System;
1423
using System.IO;
15-
16-
namespace GroupDocs.Comparison.Examples.CSharp.AdvancedUsage.Loading
17-
{
18-
using GroupDocs.Comparison;
19-
using GroupDocs.Comparison.Options;
20-
21-
/// <summary>
22-
/// This example demonstrates comparing of two texts loaded by string variables
23-
/// </summary>
24-
class LoadTextFromString
25-
{
26-
public static void Run()
27-
{
28-
Console.WriteLine("\n--------------------------------------------------------------------------------------------------------------------");
29-
Console.WriteLine("[Example Advanced Usage] # LoadTextFromString : comparing of two texts loaded by string variables\n");
30-
31-
// Pass text and instantiate LoadOptions object with set LoadText property to true (this indicates that passed string contains text to be compared, not file path)
32-
using (Comparer comparer = new Comparer("source text", new LoadOptions() { LoadText = true }))
33-
{
34-
// Use the same code structure, to pass second text
35-
comparer.Add("target text", new LoadOptions() { LoadText = true });
36-
comparer.Compare();
37-
// Call GetResultString method to get text with comparison result.
38-
Console.WriteLine("Result string: \n" + comparer.GetResultString());
39-
}
40-
Console.WriteLine($"\nTexts compared successfully.");
41-
}
42-
}
43-
}
24+
using GroupDocs.Comparison;
25+
using GroupDocs.Comparison.Options;
4426
```
27+
## Step 2: Import `GroupDocs.Comparison.Options` Namespace
28+
```csharp
29+
using GroupDocs.Comparison.Options;
30+
```
31+
### Loading Text from String in GroupDocs Comparison for .NET
32+
Comparing text from strings using GroupDocs.Comparison for .NET is a straightforward process. Follow these steps to achieve text comparison efficiently:
33+
## Step 1: Instantiate Comparer Object
34+
```csharp
35+
using (Comparer comparer = new Comparer("source text", new LoadOptions() { LoadText = true }))
36+
```
37+
Ensure to replace `"source text"` with the actual text you want to compare.
38+
## Step 2: Add Second Text for Comparison
39+
```csharp
40+
comparer.Add("target text", new LoadOptions() { LoadText = true });
41+
```
42+
Replace `"target text"` with the text you want to compare against.
43+
## Step 3: Perform Comparison
44+
```csharp
45+
comparer.Compare();
46+
```
47+
This step initiates the comparison process.
48+
## Step 4: Retrieve Comparison Result
49+
```csharp
50+
Console.WriteLine("Result string: \n" + comparer.GetResultString());
51+
```
52+
This retrieves the result of the comparison in text format.
53+
## Step 5: Finalize Comparison Process
54+
```csharp
55+
Console.WriteLine($"\nTexts compared successfully.");
56+
```
57+
This indicates the successful completion of the text comparison process.
58+
59+
## Conclusion
60+
GroupDocs.Comparison for .NET offers a seamless solution for comparing text within .NET applications. By following the steps outlined in this tutorial, developers can integrate text comparison functionality effortlessly, enhancing the efficiency and accuracy of their software solutions.
61+
## FAQ's
62+
### Is GroupDocs.Comparison for .NET compatible with all .NET frameworks?
63+
GroupDocs.Comparison for .NET supports a wide range of .NET frameworks, ensuring compatibility across various development environments.
64+
### Can I customize the comparison options using GroupDocs.Comparison for .NET?
65+
Yes, developers have the flexibility to customize comparison options according to their specific requirements, enabling tailored text comparison solutions.
66+
### Does GroupDocs.Comparison for .NET support comparison of documents other than text?
67+
Yes, GroupDocs.Comparison for .NET supports comparison of various document formats, including Word, PDF, Excel, and more, providing comprehensive document comparison capabilities.
68+
### Is there a trial version available for GroupDocs.Comparison for .NET?
69+
Yes, developers can avail of a free trial version of GroupDocs.Comparison for .NET to explore its features and capabilities before making a purchase decision.
70+
### Where can I find support for GroupDocs.Comparison for .NET?
71+
For any queries or assistance regarding GroupDocs.Comparison for .NET, developers can visit the [support forum](https://forum.groupdocs.com/c/comparison/12).

0 commit comments

Comments
 (0)