Skip to content

Commit ba57f65

Browse files
Markdown documentation added
1 parent 2a4c53e commit ba57f65

170 files changed

Lines changed: 6361 additions & 1408 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
deploy_key

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "Docs/docs-common"]
2+
path = Docs/docs-common
3+
url = https://github.com/groupdocs/docs-common.git

.travis.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
git:
2+
submodules: false
3+
4+
branches:
5+
only:
6+
- master
7+
8+
env:
9+
global:
10+
- PRODUCT=comparison
11+
- PLATFORM=java
12+
- ROOT_DIR=Docs/docs-common
13+
- SRC_DIR=Docs/docs-common/public
14+
- DEST_DIR=/var/www/docs.groupdocs.com/html
15+
16+
before_install:
17+
- openssl aes-256-cbc -K $encrypted_dfdcfd5172af_key -iv $encrypted_dfdcfd5172af_iv
18+
-in deploy_key.enc -out ./deploy_key -d
19+
- sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules
20+
- git submodule update --init --recursive Docs
21+
- git submodule foreach git pull origin master
22+
- eval "$(ssh-agent -s)"
23+
- chmod 600 ./deploy_key
24+
- echo -e "Host $HOST\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
25+
- ssh-add ./deploy_key
26+
27+
install:
28+
- curl -LO https://github.com/gohugoio/hugo/releases/download/v0.67.1/hugo_extended_0.67.1_Linux-64bit.deb
29+
- sudo dpkg -i hugo_extended_0.67.1_Linux-64bit.deb
30+
31+
script:
32+
- cp -r Docs/content/* $ROOT_DIR/content/
33+
- hugo --source $ROOT_DIR --minify --config config.toml,ignore-total-config.toml
34+
- mkdir -p $SRC_DIR/search-json
35+
- mv $SRC_DIR/index.json $SRC_DIR/search-json/$PRODUCT-$PLATFORM.json
36+
37+
after_success:
38+
- scp -i ./deploy_key -r $SRC_DIR/$PRODUCT $USER@$HOST:$DEST_DIR
39+
- scp -i ./deploy_key -r $SRC_DIR/product-sitemap.xml $USER@$HOST:$DEST_DIR/sitemaps/$PRODUCT-$PLATFORM.xml
40+
- scp -i ./deploy_key -r $SRC_DIR/search-json/$PRODUCT-$PLATFORM.json $USER@$HOST:$DEST_DIR/search-json/$PRODUCT-$PLATFORM.json

Docs/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## GroupDocs.Comparison for Java Docs
2+
3+
[![Build Status](https://travis-ci.com/groupdocs-comparison/GroupDocs.Comparison-for-Java.svg?branch=master)](https://travis-ci.com/groupdocs-comparison/GroupDocs.Comparison-for-Java)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
id: home
3+
url: comparison/java
4+
title: GroupDocs.Comparison for Java
5+
weight: 1
6+
description: ""
7+
keywords:
8+
productName: GroupDocs.Comparison for Java
9+
hideChildren: True
10+
---
11+
{{< alert style="info" >}}Welcome to the GroupDocs.Comparison for JavaIt is a Difference Checker and Documents Merging API. Supported are all industry standard document formats: PDF, OpenDocument, HTML, Microsoft Word, Excel, PowerPoint and Text files. It compares both Content and Styles of the documents. Supported with out-of-box ‘Track Changes’ functionality producing a summary file listing the source files with the changes made.{{< /alert >}}
12+
13+
## GroupDocs.Comparison for Java Resources
14+
15+
Following are the links to some useful resources you may need to accomplish your tasks.
16+
17+
* [GroupDocs.Comparison for Java Online Documentation]({{< ref "comparison/java" >}})
18+
* [GroupDocs.Comparison for Java Features]({{< ref "comparison/java/getting-started/features-overview.md" >}})
19+
* [GroupDocs.Comparison for Java Limitations]({{< ref "comparison/java/getting-started/evaluation-limitations-and-licensing-of-groupdocs.comparison.md" >}})
20+
* [GroupDocs.Comparison for Java Release Notes]({{< ref "comparison/java/release-notes/_index.md" >}})
21+
* [GroupDocs.Comparison for Java Product Page](https://products.groupdocs.com/comparison/java)
22+
* [Download GroupDocs.Comparison for Java](https://repository.groupdocs.com/webapp/#/artifacts/browse/tree/General/repo/com/groupdocs/groupdocs-comparison)
23+
* [GroupDocs.Comparison for Java API Reference Guide](https://apireference.groupdocs.com/java/comparison)
24+
* [GroupDocs.Comparison for Java Free Support Forum](https://forum.groupdocs.com/c/comparison)
25+
* [GroupDocs.Comparison for Java Paid Support Helpdesk](https://helpdesk.groupdocs.com/)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
id: developer-guide
3+
url: comparison/java/developer-guide
4+
title: Developer Guide
5+
weight: 3
6+
description: ""
7+
keywords:
8+
productName: GroupDocs.Comparison for Java
9+
hideChildren: False
10+
---
11+
{{< alert style="info" >}}This section describes some basic and advanced use cases of GroupDocs.Comparison for Java. Please refer to GitHub repository for more examples and samples.{{< /alert >}}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
id: advanced-usage
3+
url: comparison/java/advanced-usage
4+
title: Advanced Usage
5+
weight: 2
6+
description: ""
7+
keywords:
8+
productName: GroupDocs.Comparison for Java
9+
hideChildren: False
10+
---
11+
Along with the ability to compare documents using a couple lines of code **[ GroupDocs.Comparison](https://products.groupdocs.com/comparison/java)** API allows to fine tune the whole comparison process from start to end - like loading compared documents in different ways, selecting desired comparison sensitivity and detalisation level, accepting or rejecting detected changes, saving results in different ways, generate source and target documents preview in image form and many other. 
12+
13+
Learn more about advanced GroupDocs.Comparison features from the guides below.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
id: comparison
3+
url: comparison/java/comparison
4+
title: Comparison
5+
weight: 2
6+
description: ""
7+
keywords:
8+
productName: GroupDocs.Comparison for Java
9+
hideChildren: False
10+
---
11+
[**GroupDocs.Comparison**](https://products.groupdocs.com/comparison/java) provides many ways to customize changes detection algorithm logic and produced results via changing [CompareOptions](https://apireference.groupdocs.com/comparison/net/groupdocs.comparison.options/compareoptions) class properties. 
12+
Here are the list of settings that can be customized during comparison process:
13+
14+
* CalculateCoordinates - Indicates whether to calculate coordinates for changed components;
15+
* ChangedItemStyle - Describes style for changed components;
16+
* DeletedItemStyle - Describes style for deleted components;
17+
* DetalisationLevel - Gets of sets the comparison detalisation level;
18+
* DetectStyleChanges - Indicates whether to detect style changes or not;
19+
* DiagramMasterSetting - Gets or sets the path value for master or use compare without path of master (this option only for Diagram);
20+
* GenerateSummaryPage - Indicates whether to add summary page with detected changes statistics to resultant document or not;
21+
* InsertedItemStyle - Describes style for inserted components;
22+
* MarkChangedContent - Indicates whether to use frames for shapes in Word Processing and for rectangles in Image documents;
23+
* MarkNestedContent - Indicates whether to accept inserted/deleted styles for all children of inserted/deleted components;
24+
* OriginalSize - Get or sets the original sizes of comparing documents;
25+
* PasswordSaveOption - Gets or sets the password save option. More details [here]({{< ref "comparison/java/developer-guide/advanced-usage/saving/set-password-for-resultant-document.md" >}});
26+
* SensitivityOfComparison - Gets or sets the comparison sensitivity. More details [here]({{< ref "comparison/java/developer-guide/advanced-usage/comparison/adjusting-comparison-sensitivity.md" >}});
27+
* ShowDeletedContent - Indicates whether to show deleted components in resultant document or not;
28+
* WordsSeparatorChars - Sets an array of delimiters to split text into words;
29+
30+
For more details about described options please refer to the following guides:
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
id: accept-or-reject-document-changes
3+
url: comparison/java/accept-or-reject-document-changes
4+
title: Accept or Reject document changes
5+
weight: 1
6+
description: ""
7+
keywords:
8+
productName: GroupDocs.Comparison for Java
9+
hideChildren: False
10+
---
11+
**[GroupDocs.Comparison](https://products.groupdocs.com/comparison/java)** provides an ability to apply or discard specific changes between source and target files and save result with (or without) selected changes. 
12+
13+
The following are the steps to apply/reject changes to resultant file.
14+
15+
* Instantiate [Comparer](https://apireference.groupdocs.com/comparison/java/com.groupdocs.comparison/Comparer) objectwith source document path or stream;
16+
* Call [add](https://apireference.groupdocs.com/comparison/java/com.groupdocs.comparison/Comparer#add(java.lang.String)) method  and specify path target document path or stream;
17+
* Call [compare](https://apireference.groupdocs.com/comparison/java/com.groupdocs.comparison/Comparer#compare(java.lang.String)) method;
18+
* Call [getChanges](https://apireference.groupdocs.com/comparison/java/com.groupdocs.comparison/Comparer#getChanges()) method and obtain detected changes list;
19+
* Set [ComparisonAction](https://apireference.groupdocs.com/comparison/java/com.groupdocs.comparison.result/ComparisonAction) of needed change object to [ComparisonAction.ACCEPT](https://apireference.groupdocs.com/comparison/java/com.groupdocs.comparison.result/ComparisonAction#ACCEPT) or [ComparisonAction.REJECT](https://apireference.groupdocs.com/comparison/java/com.groupdocs.comparison.result/ComparisonAction#REJECT) value;
20+
* Call [applyChanges](https://apireference.groupdocs.com/comparison/java/com.groupdocs.comparison/Comparer#applyChanges(java.io.OutputStream,%20com.groupdocs.comparison.options.ApplyChangeOptions)) method and pass collection of changes to it;
21+
22+
ApplyChangeOptions class:
23+
24+
* **getChanges** - List of changes that must be applied (or not) to the resulting document;
25+
26+
The following code sample shows how to accept/reject detected changes.
27+
28+
## Accept or Reject changes from local disk
29+
30+
```java
31+
Comparer comparer = new Comparer("C:\\source.pdf");
32+
try {
33+
comparer.add("C:\\target.pdf");
34+
comparer.compare("C:\\result.pdf");
35+
} finally {
36+
comparer.dispose();
37+
}
38+
```
39+
40+
## Accept or Reject changes from stream
41+
42+
```java
43+
Comparer comparer = new Comparer("C:\\source.pdf");
44+
try {
45+
comparer.add("C:\\target.pdf");
46+
comparer.compare();
47+
ChangeInfo[] changes = comparer.getChanges();
48+
changes[0].setComparisonAction(ComparisonAction.REJECT);
49+
comparer.applyChanges(new FileOutputStream("C:\\result.pdf"), new ApplyChangeOptions(changes));
50+
} finally {
51+
comparer.dispose();
52+
}
53+
```
54+
55+
## More resources
56+
57+
### GitHub Examples
58+
You may easily run the code above and see the feature in action in our GitHub examples:
59+
60+
* [GroupDocs.Comparison for Java examples, plugins, and showcase](https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java)
61+
* [GroupDocs.Comparison for .NET examples, plugins, and showcase](https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-.NET)
62+
* [Document Comparison for Java App Dropwizard UI Modern Example](https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java-Dropwizard)
63+
* [Document Comparison for Java Spring UI Example](https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java-Spring)
64+
* [Document Comparison for .NET MVC UI Example](https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-.NET-MVC)
65+
* [Document Comparison for .NET App WebForms UI Modern Example](https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-.NET-WebForms)
66+
67+
68+
### Free Online App
69+
Along with full-featured Java library we provide simple, but powerful free Apps.
70+
You are welcome to compare your DOC or DOCX, XLS or XLSX, PPT or PPTX, PDF, EML, EMLX, MSGand other documents with free to use online **[GroupDocs Comparison App](https://products.groupdocs.app/comparison)**.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
id: adjusting-comparison-sensitivity
3+
url: comparison/java/adjusting-comparison-sensitivity
4+
title: Adjusting comparison sensitivity
5+
weight: 2
6+
description: ""
7+
keywords:
8+
productName: GroupDocs.Comparison for Java
9+
hideChildren: False
10+
---
11+
**[GroupDocs.Comparison](https://products.groupdocs.com/comparison/java)** allows to adjust comparison sensitivity to achieve the necessary balance between file comparison speed and accuracy. Possible comparison sensitivity values range is from **0** to **100**.
12+
13+
* **Minimal value** - the minimal value is **0**. Setting sensitivity to a minimal value provides the fastest comparison speed, but it may produce worst comparison quality.
14+
If there is at least one common letter in two compared words then these words will not be treated as fully inserted and deleted
15+
* **Value by default**  - the default value is **75**. Comparison occurs when the percentage of deleted or inserted elements in relation to all elements does not exceed 75%.
16+
* **Maximum value** - the maximum values is **100**. Comparison occurs at any length of a common sub-sequence of two compared objects. This option provides the best quality, but slowest comparison speed.
17+
18+
For better understanding about how comparison algorithms work let's suppose we have two strings:
19+
20+
```java
21+
1. It is our equity poetry
22+
2. Jack is a glad calf
23+
```
24+
25+
*Case 1.* If **SensitivityOfComparison = 80%** comparison of these two strings will produce the next result:We will highlight removed text parts with **red **and inserted parts with **blue** color. So, these strings have two common sub-sequences: **"is "** word and 4 space symbols.
26+
Common sub-sequence is - **"is   "** and its length is 6 symbols (there are 4 space symbols in it).
27+
Length of inserted sub-sequence is 13 symbols - **Jackagladcalf** Removed sub-sequence length is 17 symbols - **Itourequitypoetry** Lets calculate percent of removed and inserted symbols: (17 + 13) / (17 + 13 + 6) \* 100 = 83%
28+
29+
**Jack is a glad calf****It is our equity poetry**
30+
31+
Because calculated percent of removed and inserted symbols equals **83%** and it is bigger than value of **SensitivityOfComparison** (equals **80%**) then this common sub-sequence will be not taken into account.
32+
The first string considered completely removed and the second string considered completely inserted. The same results will be produced for any calculated percent less than **83%**.
33+
34+
*Case 2. *If**SensitivityOfComparison = 85%**, comparison of these two strings will produce the next result:
35+
**Jack****It**** is ****a****our****glad****equity****calf****poetry**
36+
37+
Common sub-sequence was found, because **85% > 83%**. The same results will be produced for any calculated percent bigger than **83%**.
38+
39+
Here are the steps to compare files with specific comparison sensitivity:
40+
41+
* Instantiate [Comparer](https://apireference.groupdocs.com/comparison/java/com.groupdocs.comparison/Comparer) objectwith source file path or stream;
42+
* Call [add](https://apireference.groupdocs.com/comparison/java/com.groupdocs.comparison/Comparer#add(java.lang.String)) method and specify target file path or stream.
43+
* Instantiate [CompareOptions](https://apireference.groupdocs.com/comparison/java/com.groupdocs.comparison.options/CompareOptions) object with desired [setSensitivityOfComparison](https://apireference.groupdocs.com/comparison/java/com.groupdocs.comparison.options/CompareOptions#getSensitivityOfComparison()) value;
44+
* Call [compare](https://apireference.groupdocs.com/comparison/java/com.groupdocs.comparison/Comparer#compare(java.lang.String,%20com.groupdocs.comparison.options.CompareOptions)) method and pass [CompareOptions](https://apireference.groupdocs.com/comparison/java/com.groupdocs.comparison.options/CompareOptions) object to method;
45+
46+
47+
The following code snippet demonstrates how compare files with specific sensitivity: 
48+
49+
## Compare files with sensitivity adjustment
50+
51+
```java
52+
Comparer comparer = new Comparer("C:\\source.pdf");
53+
try {
54+
comparer.add("C:\\target.pdf");
55+
56+
CompareOptions compareOptions = new CompareOptions();
57+
compareOptions.setSensitivityOfComparison(100);
58+
59+
comparer.compare("C:\\result.pdf", compareOptions);
60+
} finally {
61+
comparer.dispose();
62+
}
63+
```
64+
65+
## More resources
66+
67+
### GitHub Examples
68+
You may easily run the code above and see the feature in action in our GitHub examples:
69+
70+
* [GroupDocs.Comparison for Java examples, plugins, and showcase](https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java)
71+
* [GroupDocs.Comparison for .NET examples, plugins, and showcase](https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-.NET)
72+
* [Document Comparison for Java App Dropwizard UI Modern Example](https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java-Dropwizard)
73+
* [Document Comparison for Java Spring UI Example](https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java-Spring)
74+
* [Document Comparison for .NET MVC UI Example](https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-.NET-MVC)
75+
* [Document Comparison for .NET App WebForms UI Modern Example](https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-.NET-WebForms)
76+
77+
78+
### Free Online App
79+
Along with full-featured Java library we provide simple, but powerful free Apps.
80+
You are welcome to compare your DOC or DOCX, XLS or XLSX, PPT or PPTX, PDF, EML, EMLX, MSGand other documents with free to use online **[GroupDocs Comparison App](https://products.groupdocs.app/comparison)**.

0 commit comments

Comments
 (0)