@groupdocs/groupdocs.comparison 23.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<title>GroupDocs - End User License Agreement (EULA)</title>
|
|
4
|
+
<meta http-equiv="refresh" content="0; url=https://company.groupdocs.com/legal/eula" />
|
|
5
|
+
</head>
|
|
6
|
+
<body>
|
|
7
|
+
<p>Please wait. You'll be redirected to the online version of EULA.</p>
|
|
8
|
+
<p>If it fails to redirect then please go the following link manually: <a href="https://company.groupdocs.com/legal/eula">https://company.groupdocs.com/legal/eula</a></p>
|
|
9
|
+
</body>
|
|
10
|
+
</html>
|
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
**GroupDocs.Comparison for Node.js via Java** is a powerful API to compare over 50 types of documents and images, including all Microsoft Office and OpenDocument file formats, PDF documents, raster images (TIFF, JPEG, GIF, PNG, BMP). Retrieve the list of changes in the desired format with a line-by-line comparison of content, paragraphs, characters, styles, shapes, and position..
|
|
2
|
+
|
|
3
|
+
## Node.js Comparator API Features
|
|
4
|
+
- Compare and detect differences among similar documents.
|
|
5
|
+
- Support for 55+ popular document formats from various categories.
|
|
6
|
+
- Visual separation of detected changes with the ability to accept or reject modifications.
|
|
7
|
+
- Generate document preview.
|
|
8
|
+
- Compare paragraph, word as well as characters.
|
|
9
|
+
- Identify content styling and formatting changes.
|
|
10
|
+
- Set metadata from the source, target files or keep it user-defined.
|
|
11
|
+
- Make the resultant document password protected.
|
|
12
|
+
- Load source document with extended options;
|
|
13
|
+
- Specify password for password-protected documents.
|
|
14
|
+
- Load specific part or pages of the document.
|
|
15
|
+
- Hide or show document comments.
|
|
16
|
+
|
|
17
|
+
## Supported File Formats
|
|
18
|
+
**PDF:** PDF (version 1.3, 1.4, 1.5, 1.6, 1.7)
|
|
19
|
+
**Word Processing:** DOC, DOCM, DOCX, DOT, DOTM, DOTX, MD, RTF, TXT
|
|
20
|
+
**Spreadsheet:** XLS, XLSX, XLSB, XLTX, XLTM, XLSM, CSV, NUMBERS, ODS
|
|
21
|
+
**Presentation:** PPT, PPTX, PPS, PPSX, POTM, POTX, POT, PPSM, PPTM
|
|
22
|
+
**OpenOffice:** ODS, ODP, OTP, ODT, OTT,
|
|
23
|
+
**Images:** JPG, PNG, SVG, BMP, GIF, AI, DJVU, ICO, TIFF
|
|
24
|
+
**CAD:** CF2, DGN, DWFX, DWT
|
|
25
|
+
**Compression:** 7Z, GZIP, RAR, ZIP
|
|
26
|
+
**Database:** LOG, NSF, SQL
|
|
27
|
+
**Diagram:** VDX, VSD, VSDM, VSDX
|
|
28
|
+
**eBook:** AZW3, EPUB, MOBI
|
|
29
|
+
**Email and Outlook:** EML, EMLX, MSG, PST
|
|
30
|
+
**Font:** CFF, EOT, OTF, TTF
|
|
31
|
+
**Page Description Language:** CGM, PS, SVG, XPS
|
|
32
|
+
**Project Management:** MPP, MPT, XER
|
|
33
|
+
**Publisher:** PUB
|
|
34
|
+
**Web:** HTML, JSON, VDW, XML
|
|
35
|
+
|
|
36
|
+
## Getting Started with GroupDocs.Comparison for Node.js via Java
|
|
37
|
+
### Installation
|
|
38
|
+
|
|
39
|
+
From the command line:
|
|
40
|
+
|
|
41
|
+
npm i @groupdocs/groupdocs.comparison
|
|
42
|
+
|
|
43
|
+
### Convert DOCX to HTML using Node.js
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
const comparator = new groupdocs.conversion.Comparator("sample.docx")
|
|
47
|
+
const options = new groupdocs.conversion.MarkupConvertOptions()
|
|
48
|
+
comparator.compare("ConvertToHtml.html", options);
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Convert PDF to DOCX using Node.js
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
const converter = new groupdocs.conversion.Converter("sample.pdf")
|
|
55
|
+
const options = new groupdocs.conversion.WordProcessingConvertOptions()
|
|
56
|
+
converter.convert("output.docx", options)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Convert Word to Presentation via Node.js
|
|
60
|
+
|
|
61
|
+
```js
|
|
62
|
+
const converter = new groupdocs.conversion.Converter(inputFilePath)
|
|
63
|
+
const options = new groupdocs.conversion.PresentationConvertOptions()
|
|
64
|
+
converter.convert("output.pptx", options)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
[Home](https://www.groupdocs.com/) | [Product Page](https://products.groupdocs.com/conversion/nodejs-java) | [Documentation](https://docs.groupdocs.com/conversion/nodejs-java/) | [Blog](https://blog.groupdocs.com/category/conversion/) | [API Reference](https://apireference.groupdocs.com/conversion/nodejs-java) | [Code Samples](https://github.com/groupdocs-conversion/GroupDocs.Conversion-for-Node.js-via-Java) | [Free Support](forum.groupdocs.com/c/conversion) | [Temporary License](https://purchase.groupdocs.com/temporary-license)
|
package/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
(() => {
|
|
5
|
+
function checkFileExists(filePath) {
|
|
6
|
+
try {
|
|
7
|
+
fs.accessSync(filePath, fs.constants.F_OK);
|
|
8
|
+
return true;
|
|
9
|
+
} catch {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (!checkFileExists(path.join(__dirname, 'lib/groupdocs-comparison-23.10.jar'))) {
|
|
15
|
+
console.warn('\x1b[33m%s\x1b[0m', `File groupdocs-comparison-23.10.jar not found in the lib directory.\nPlease navigate to the package directory:`);
|
|
16
|
+
console.log('\n cd node_modules/@groupdocs/groupdocs.comparison\n');
|
|
17
|
+
console.warn('\x1b[33m%s\x1b[0m', `Then download the JAR file using the command:`);
|
|
18
|
+
console.log('\n npm run postinstall\n');
|
|
19
|
+
process.exit(0)
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
module.exports = require("./lib/groupdocs.comparison");
|
|
23
|
+
}
|
|
24
|
+
})()
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
const path = require('path')
|
|
2
|
+
const java = require('java')
|
|
3
|
+
const os = require('os')
|
|
4
|
+
|
|
5
|
+
if (os.platform() === 'darwin') {
|
|
6
|
+
java.options.push('-Djava.awt.headless=true')
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
java.asyncOptions = {
|
|
10
|
+
asyncSuffix: 'Async',
|
|
11
|
+
syncSuffix: '',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
java.classpath.push(path.join(__dirname, '/groupdocs-comparison-23.10.jar'))
|
|
15
|
+
|
|
16
|
+
exports = module.exports
|
|
17
|
+
|
|
18
|
+
function __typeof__(objClass) {
|
|
19
|
+
if (objClass !== undefined && objClass.constructor) {
|
|
20
|
+
const strFun = objClass.constructor.toString()
|
|
21
|
+
let className = strFun.substr(0, strFun.indexOf('('))
|
|
22
|
+
className = className.replace('function', '')
|
|
23
|
+
return className.replace(/(^\s*)|(\s*$)/gi, '')
|
|
24
|
+
}
|
|
25
|
+
return typeof objClass
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** STREAM HELPERS * */
|
|
29
|
+
exports.readDataFromStream = function (readStream, callback) {
|
|
30
|
+
const inputStreamBuffer = new exports.StreamBuffer()
|
|
31
|
+
readStream.on('data', chunk => {
|
|
32
|
+
inputStreamBuffer.write(chunk)
|
|
33
|
+
})
|
|
34
|
+
readStream.on('end', () => {
|
|
35
|
+
callback(inputStreamBuffer.toInputStream())
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
exports.readBytesFromStream = function (readStream, callback) {
|
|
40
|
+
const inputStreamBuffer = new exports.StreamBuffer()
|
|
41
|
+
readStream.on('data', chunk => {
|
|
42
|
+
inputStreamBuffer.write(chunk)
|
|
43
|
+
})
|
|
44
|
+
readStream.on('end', () => {
|
|
45
|
+
const array = Array.from(inputStreamBuffer.toByteArray())
|
|
46
|
+
const javaArray = java.newArray('byte', array)
|
|
47
|
+
callback(javaArray)
|
|
48
|
+
})
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
exports.Comparer = java.import("com.groupdocs.comparison.Comparer");
|
|
53
|
+
exports.ComparerSettings = java.import("com.groupdocs.comparison.ComparerSettings");
|
|
54
|
+
exports.Document = java.import("com.groupdocs.comparison.Document");
|
|
55
|
+
exports.Utils = java.import("com.groupdocs.comparison.common.Utils");
|
|
56
|
+
exports.Delegates = java.import("com.groupdocs.comparison.common.delegates.Delegates");
|
|
57
|
+
exports.ComparisonException = java.import("com.groupdocs.comparison.common.exceptions.ComparisonException");
|
|
58
|
+
exports.DocumentComparisonException = java.import("com.groupdocs.comparison.common.exceptions.DocumentComparisonException");
|
|
59
|
+
exports.FileFormatException = java.import("com.groupdocs.comparison.common.exceptions.FileFormatException");
|
|
60
|
+
exports.InvalidPasswordException = java.import("com.groupdocs.comparison.common.exceptions.InvalidPasswordException");
|
|
61
|
+
exports.PasswordProtectedFileException = java.import("com.groupdocs.comparison.common.exceptions.PasswordProtectedFileException");
|
|
62
|
+
exports.UnsupportedFileFormatException = java.import("com.groupdocs.comparison.common.exceptions.UnsupportedFileFormatException");
|
|
63
|
+
exports.DefaultTemporaryFileManager = java.import("com.groupdocs.comparison.common.tempfiles.DefaultTemporaryFileManager");
|
|
64
|
+
exports.License = java.import("com.groupdocs.comparison.license.License");
|
|
65
|
+
exports.Metered = java.import("com.groupdocs.comparison.license.Metered");
|
|
66
|
+
exports.ConsoleLogger = java.import("com.groupdocs.comparison.logging.ConsoleLogger");
|
|
67
|
+
exports.ApplyChangeOptions = java.import("com.groupdocs.comparison.options.ApplyChangeOptions");
|
|
68
|
+
exports.CompareOptions = java.import("com.groupdocs.comparison.options.CompareOptions");
|
|
69
|
+
exports.FileAuthorMetadata = java.import("com.groupdocs.comparison.options.FileAuthorMetadata");
|
|
70
|
+
exports.GetChangeOptions = java.import("com.groupdocs.comparison.options.GetChangeOptions");
|
|
71
|
+
exports.OriginalSize = java.import("com.groupdocs.comparison.options.OriginalSize");
|
|
72
|
+
exports.PreviewOptions = java.import("com.groupdocs.comparison.options.PreviewOptions");
|
|
73
|
+
exports.LoadOptions = java.import("com.groupdocs.comparison.options.load.LoadOptions");
|
|
74
|
+
exports.SaveOptions = java.import("com.groupdocs.comparison.options.save.SaveOptions");
|
|
75
|
+
exports.DiagramMasterSetting = java.import("com.groupdocs.comparison.options.style.DiagramMasterSetting");
|
|
76
|
+
exports.Size = java.import("com.groupdocs.comparison.options.style.Size");
|
|
77
|
+
exports.StyleSettings = java.import("com.groupdocs.comparison.options.style.StyleSettings");
|
|
78
|
+
exports.ChangeInfo = java.import("com.groupdocs.comparison.result.ChangeInfo");
|
|
79
|
+
exports.PageInfo = java.import("com.groupdocs.comparison.result.PageInfo");
|
|
80
|
+
exports.Rectangle = java.import("com.groupdocs.comparison.result.Rectangle");
|
|
81
|
+
exports.StyleChangeInfo = java.import("com.groupdocs.comparison.result.StyleChangeInfo");
|
|
82
|
+
exports.CultureInfo = java.import("com.groupdocs.comparison.utils.CultureInfo");
|
|
83
|
+
exports.MemoryCleaner = java.import("com.groupdocs.comparison.utils.MemoryCleaner");
|
|
84
|
+
exports.FontsHelper = java.import("com.groupdocs.comparison.utils.common.FontsHelper");
|
|
85
|
+
exports.ApplyRevisionOptions = java.import("com.groupdocs.comparison.words.revision.ApplyRevisionOptions");
|
|
86
|
+
exports.RevisionHandler = java.import("com.groupdocs.comparison.words.revision.RevisionHandler");
|
|
87
|
+
exports.RevisionInfo = java.import("com.groupdocs.comparison.words.revision.RevisionInfo");
|
|
88
|
+
|
|
89
|
+
exports.MergeType = java.import("com.groupdocs.comparison.cells.style.MergeType");
|
|
90
|
+
exports.TemporaryFileManagerFactory = java.import("com.groupdocs.comparison.common.tempfiles.TemporaryFileManagerFactory");
|
|
91
|
+
exports.SupportedLocales = java.import("com.groupdocs.comparison.localization.SupportedLocales");
|
|
92
|
+
exports.ComparisonLogger = java.import("com.groupdocs.comparison.logging.ComparisonLogger");
|
|
93
|
+
exports.ComparisonType = java.import("com.groupdocs.comparison.options.enums.ComparisonType");
|
|
94
|
+
exports.FolderComparisonExtension = java.import("com.groupdocs.comparison.options.enums.FolderComparisonExtension");
|
|
95
|
+
exports.MetadataType = java.import("com.groupdocs.comparison.options.enums.MetadataType");
|
|
96
|
+
exports.PaperSize = java.import("com.groupdocs.comparison.options.enums.PaperSize");
|
|
97
|
+
exports.PasswordSaveOption = java.import("com.groupdocs.comparison.options.enums.PasswordSaveOption");
|
|
98
|
+
exports.PreviewFormats = java.import("com.groupdocs.comparison.options.enums.PreviewFormats");
|
|
99
|
+
exports.DetalisationLevel = java.import("com.groupdocs.comparison.options.style.DetalisationLevel");
|
|
100
|
+
exports.ChangeType = java.import("com.groupdocs.comparison.result.ChangeType");
|
|
101
|
+
exports.ComparisonAction = java.import("com.groupdocs.comparison.result.ComparisonAction");
|
|
102
|
+
exports.FileType = java.import("com.groupdocs.comparison.result.FileType");
|
|
103
|
+
exports.Path = java.import("com.groupdocs.comparison.utils.common.Path");
|
|
104
|
+
exports.RevisionAction = java.import("com.groupdocs.comparison.words.revision.RevisionAction");
|
|
105
|
+
exports.RevisionType = java.import("com.groupdocs.comparison.words.revision.RevisionType");
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
exports.StreamBuffer = class StreamBuffer {
|
|
109
|
+
constructor() {
|
|
110
|
+
const self = java.newInstanceSync('com.groupdocs.comparison.contracts.StreamBuffer')
|
|
111
|
+
|
|
112
|
+
self.write = function (chunk) {
|
|
113
|
+
const array = Array.from(chunk)
|
|
114
|
+
const javaArray = java.newArray('byte', array)
|
|
115
|
+
self.__proto__.write.call(self, javaArray, 0, javaArray.length)
|
|
116
|
+
}
|
|
117
|
+
return self
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** STREAM METHODS * */
|
|
122
|
+
exports.License.setLicenseFromStream = function (license, licenseStream, callback) {
|
|
123
|
+
const inputStreamBuffer = new exports.StreamBuffer()
|
|
124
|
+
licenseStream.on('data', chunk => {
|
|
125
|
+
inputStreamBuffer.write(chunk)
|
|
126
|
+
})
|
|
127
|
+
licenseStream.on('end', () => {
|
|
128
|
+
let error
|
|
129
|
+
try {
|
|
130
|
+
license.setLicense(inputStreamBuffer.toInputStream())
|
|
131
|
+
} catch (err) {
|
|
132
|
+
error = err
|
|
133
|
+
}
|
|
134
|
+
callback(error)
|
|
135
|
+
})
|
|
136
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@groupdocs/groupdocs.comparison",
|
|
3
|
+
"version": "23.10.0",
|
|
4
|
+
"description": "Powerful comparison tool for PDF, Word, Excel, PowerPoint and image files.",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"postinstall": "curl -H 'Cache-Control:no-cache' https://releases.groupdocs.com/java/repo/com/groupdocs/groupdocs-comparison/23.10/groupdocs-comparison-23.10.jar > lib/groupdocs-comparison-23.10.jar"
|
|
7
|
+
},
|
|
8
|
+
"main": "index.js",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"PDF",
|
|
11
|
+
"Word",
|
|
12
|
+
"DOCX",
|
|
13
|
+
"DOC",
|
|
14
|
+
"PowerPoint",
|
|
15
|
+
"PPT",
|
|
16
|
+
"PPTX",
|
|
17
|
+
"Excel",
|
|
18
|
+
"XLS",
|
|
19
|
+
"XLSX",
|
|
20
|
+
"CSV",
|
|
21
|
+
"to",
|
|
22
|
+
"JPG",
|
|
23
|
+
"PNG",
|
|
24
|
+
"Spreadsheet",
|
|
25
|
+
"SVG"
|
|
26
|
+
],
|
|
27
|
+
"author": "Aspose",
|
|
28
|
+
"license": "End User License Agreement.html",
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"java": "^0.13.0"
|
|
31
|
+
},
|
|
32
|
+
"directories": {
|
|
33
|
+
"lib": "lib"
|
|
34
|
+
}
|
|
35
|
+
}
|