@groupdocs/groupdocs.viewer 23.8.0 → 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.
- package/index.js +2 -2
- package/lib/groupdocs.viewer.js +18 -30
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -11,8 +11,8 @@ const path = require('path');
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
if (!checkFileExists(path.join(__dirname, 'lib/groupdocs-viewer-nodejs-23.
|
|
15
|
-
console.warn('\x1b[33m%s\x1b[0m', `File groupdocs-viewer-nodejs-23.
|
|
14
|
+
if (!checkFileExists(path.join(__dirname, 'lib/groupdocs-viewer-nodejs-23.10.1.jar'))) {
|
|
15
|
+
console.warn('\x1b[33m%s\x1b[0m', `File groupdocs-viewer-nodejs-23.10.1.jar not found in the lib directory.\nPlease navigate to the package directory:`);
|
|
16
16
|
console.log('\n cd node_modules/@groupdocs/groupdocs.viewer\n')
|
|
17
17
|
console.warn('\x1b[33m%s\x1b[0m', `Then download the JAR file using the command:`);
|
|
18
18
|
console.log('\n npm run postinstall\n');
|
package/lib/groupdocs.viewer.js
CHANGED
|
@@ -11,7 +11,7 @@ java.asyncOptions = {
|
|
|
11
11
|
syncSuffix: '',
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
java.classpath.push(path.join(__dirname, '/groupdocs-viewer-nodejs-23.
|
|
14
|
+
java.classpath.push(path.join(__dirname, '/groupdocs-viewer-nodejs-23.10.1.jar'))
|
|
15
15
|
|
|
16
16
|
exports = module.exports
|
|
17
17
|
|
|
@@ -26,14 +26,21 @@ function __typeof__(objClass) {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/** STREAM HELPERS * */
|
|
29
|
-
exports.readDataFromStream = function (readStream
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
inputStreamBuffer.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
exports.readDataFromStream = function (readStream) {
|
|
30
|
+
|
|
31
|
+
return new Promise((resolve, reject) => {
|
|
32
|
+
const inputStreamBuffer = new exports.StreamBuffer()
|
|
33
|
+
readStream.on('data', chunk => {
|
|
34
|
+
inputStreamBuffer.write(chunk)
|
|
35
|
+
})
|
|
36
|
+
readStream.on('end', () => {
|
|
37
|
+
try {
|
|
38
|
+
resolve(inputStreamBuffer.toInputStream())
|
|
39
|
+
} catch (err) {
|
|
40
|
+
reject(err);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
});
|
|
37
44
|
}
|
|
38
45
|
|
|
39
46
|
exports.readBytesFromStream = function (readStream, callback) {
|
|
@@ -48,7 +55,6 @@ exports.readBytesFromStream = function (readStream, callback) {
|
|
|
48
55
|
})
|
|
49
56
|
}
|
|
50
57
|
|
|
51
|
-
|
|
52
58
|
exports.License = java.import("com.groupdocs.viewer.License");
|
|
53
59
|
exports.Metered = java.import("com.groupdocs.viewer.Metered");
|
|
54
60
|
exports.Viewer = java.import("com.groupdocs.viewer.Viewer");
|
|
@@ -89,6 +95,7 @@ exports.TextOptions = java.import("com.groupdocs.viewer.options.TextOptions");
|
|
|
89
95
|
exports.Tile = java.import("com.groupdocs.viewer.options.Tile");
|
|
90
96
|
exports.VisioRenderingOptions = java.import("com.groupdocs.viewer.options.VisioRenderingOptions");
|
|
91
97
|
exports.Watermark = java.import("com.groupdocs.viewer.options.Watermark");
|
|
98
|
+
exports.WebDocumentOptions = java.import("com.groupdocs.viewer.options.WebDocumentOptions");
|
|
92
99
|
exports.WordProcessingOptions = java.import("com.groupdocs.viewer.options.WordProcessingOptions");
|
|
93
100
|
exports.ArchiveViewInfoImpl = java.import("com.groupdocs.viewer.results.ArchiveViewInfoImpl");
|
|
94
101
|
exports.AttachmentImpl = java.import("com.groupdocs.viewer.results.AttachmentImpl");
|
|
@@ -128,7 +135,6 @@ exports.TimeUnit = java.import("com.groupdocs.viewer.options.TimeUnit");
|
|
|
128
135
|
exports.ViewInfoOptions = java.import("com.groupdocs.viewer.options.ViewInfoOptions");
|
|
129
136
|
exports.PathUtils = java.import("com.groupdocs.viewer.utils.PathUtils");
|
|
130
137
|
|
|
131
|
-
|
|
132
138
|
exports.StreamBuffer = class StreamBuffer {
|
|
133
139
|
constructor() {
|
|
134
140
|
const self = java.newInstanceSync('com.groupdocs.viewer.utils.StreamBuffer')
|
|
@@ -140,22 +146,4 @@ exports.StreamBuffer = class StreamBuffer {
|
|
|
140
146
|
}
|
|
141
147
|
return self
|
|
142
148
|
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/** STREAM METHODS * */
|
|
146
|
-
|
|
147
|
-
exports.License.setLicenseFromStream = function (license, licenseStream, callback) {
|
|
148
|
-
const inputStreamBuffer = new exports.StreamBuffer()
|
|
149
|
-
licenseStream.on('data', chunk => {
|
|
150
|
-
inputStreamBuffer.write(chunk)
|
|
151
|
-
})
|
|
152
|
-
licenseStream.on('end', () => {
|
|
153
|
-
let error
|
|
154
|
-
try {
|
|
155
|
-
license.setLicense(inputStreamBuffer.toInputStream())
|
|
156
|
-
} catch (err) {
|
|
157
|
-
error = err
|
|
158
|
-
}
|
|
159
|
-
callback(error)
|
|
160
|
-
})
|
|
161
|
-
}
|
|
149
|
+
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@groupdocs/groupdocs.viewer",
|
|
3
|
-
"version": "23.
|
|
3
|
+
"version": "23.10.0",
|
|
4
4
|
"description": "Powerful, high-performance and cross-platform library that allows you to build desktop and web file viewer applications.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"postinstall": "curl -H 'Cache-Control:no-cache' https://releases.groupdocs.com/java/repo/com/groupdocs/groupdocs-viewer-nodejs/23.
|
|
7
|
+
"postinstall": "curl -H 'Cache-Control:no-cache' https://releases.groupdocs.com/java/repo/com/groupdocs/groupdocs-viewer-nodejs/23.10.1/groupdocs-viewer-nodejs-23.10.1.jar > lib/groupdocs-viewer-nodejs-23.10.1.jar"
|
|
8
8
|
},
|
|
9
9
|
"keywords": [
|
|
10
10
|
"view",
|