@groupdocs/groupdocs.viewer 24.8.0 → 25.12.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/End User License Agreement.html +7 -5
- package/README.md +168 -32
- package/index.js +2 -2
- package/lib/groupdocs.viewer.js +158 -152
- package/package.json +29 -21
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
<html>
|
|
2
2
|
<head>
|
|
3
|
-
<title>GroupDocs - End User License Agreement (EULA)</title>
|
|
4
|
-
<meta http-equiv="refresh" content="0; url=https://
|
|
3
|
+
<title>GroupDocs - End User License Agreement (EULA)</title>
|
|
4
|
+
<meta http-equiv="refresh" content="0; url=https://about.groupdocs.com/legal/eula/" />
|
|
5
5
|
</head>
|
|
6
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:
|
|
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:
|
|
9
|
+
<a href="https://about.groupdocs.com/legal/eula/">https://about.groupdocs.com/legal/eula/</a>
|
|
10
|
+
</p>
|
|
9
11
|
</body>
|
|
10
|
-
</html>
|
|
12
|
+
</html>
|
package/README.md
CHANGED
|
@@ -1,54 +1,190 @@
|
|
|
1
|
-
|
|
1
|
+
Document viewer API for Node.js (powered by Java) to render and preview 170+ file formats (PDF, Word, Excel, PowerPoint, CAD, images, archives, email, and more) as HTML, PDF, PNG, and JPEG.
|
|
2
2
|
|
|
3
|
-
##
|
|
4
|
-
- Display document content in any web-browser.
|
|
5
|
-
- View document pages separately.
|
|
6
|
-
- Rotate, reorder pages or add watermarks.
|
|
7
|
-
- Customizable resource management options for CSS, fonts & images.
|
|
8
|
-
- Render all pages of a document as a single PDF.
|
|
9
|
-
- Boost document loading speed with configurable caching.
|
|
10
|
-
- Extract document text along with words' coordinates.
|
|
11
|
-
- Extract basic information about source documents such as file type, pages count and so on.
|
|
12
|
-
- Auto-detect document type.
|
|
13
|
-
- Replace missing font or use custom fonts for rendering.
|
|
3
|
+
## Quick links
|
|
14
4
|
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
- [Product Home](https://products.groupdocs.com/viewer/nodejs-java/)
|
|
6
|
+
- [Release Notes](https://releases.groupdocs.com/viewer/nodejs-java/release-notes/)
|
|
7
|
+
- [Documentation](https://docs.groupdocs.com/viewer/nodejs-java/)
|
|
8
|
+
- [System Requirements](https://docs.groupdocs.com/viewer/nodejs-java/system-requirements/)
|
|
9
|
+
- [Installation Guide](https://docs.groupdocs.com/viewer/nodejs-java/installation/)
|
|
10
|
+
- [Support](https://forum.groupdocs.com/)
|
|
11
|
+
- [Pricing](https://purchase.groupdocs.com/pricing/viewer/nodejs-java/)
|
|
17
12
|
|
|
13
|
+
## Key Features
|
|
14
|
+
|
|
15
|
+
- Render documents for viewing in any web browser.
|
|
16
|
+
- View pages separately, rotate/reorder pages, and add watermarks.
|
|
17
|
+
- Render with embedded/external resources; customize CSS, fonts, and images.
|
|
18
|
+
- Render all pages as a single PDF, or as images (PNG/JPEG).
|
|
19
|
+
- Speed up loading with configurable caching.
|
|
20
|
+
- Extract text and coordinates; read file info (type, pages count, etc.).
|
|
21
|
+
- Auto-detect file type; replace missing fonts or use custom fonts.
|
|
22
|
+
|
|
23
|
+
## Supported Formats
|
|
24
|
+
|
|
25
|
+
View documents in [popular file formats](https://docs.groupdocs.com/viewer/nodejs-java/supported-document-formats/) (DOCX, XLSX, PPTX, PDF, DWG, PSD, HTML, ZIP, and many more).
|
|
26
|
+
|
|
27
|
+
### Documents & Office
|
|
28
|
+
|
|
29
|
+
- **PDF:** PDF
|
|
30
|
+
- **Word Processing:** DOC, DOCX, RTF, TXT
|
|
31
|
+
- **Spreadsheet:** XLS, XLSX, CSV
|
|
32
|
+
- **Presentation:** PPT, PPTX
|
|
33
|
+
|
|
34
|
+
### Other Formats
|
|
35
|
+
|
|
36
|
+
- **CAD:** DWG, DXF, DGN
|
|
37
|
+
- **Images:** JPG, PNG, SVG, TIFF
|
|
38
|
+
- **Email:** EML, MSG, PST
|
|
39
|
+
- **Archives:** ZIP, RAR, 7Z
|
|
40
|
+
- **Web:** HTML
|
|
41
|
+
|
|
42
|
+
## Getting Started
|
|
43
|
+
|
|
44
|
+
### Prerequisites
|
|
45
|
+
|
|
46
|
+
- Node.js (LTS recommended)
|
|
47
|
+
- Java Runtime Environment (JRE) 8 or later
|
|
48
|
+
- Windows, Linux, or macOS
|
|
18
49
|
|
|
19
|
-
## Getting Started with GroupDocs.Viewer for Node.js via Java
|
|
20
50
|
### Installation
|
|
21
51
|
|
|
22
|
-
|
|
52
|
+
Install the package from npm:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npm i @groupdocs/groupdocs.viewer
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
For detailed setup instructions, see the [System Requirements](https://docs.groupdocs.com/viewer/nodejs-java/system-requirements/) and [Installation](https://docs.groupdocs.com/viewer/nodejs-java/installation/) documentation topics.
|
|
59
|
+
|
|
60
|
+
### Use cases
|
|
23
61
|
|
|
24
|
-
|
|
62
|
+
Below are simple Node.js snippets that demonstrate typical use cases.
|
|
25
63
|
|
|
26
|
-
|
|
64
|
+
#### Render DOCX to HTML
|
|
65
|
+
|
|
66
|
+
This code example shows how to render a DOCX to HTML files with embedded resources.
|
|
27
67
|
|
|
28
68
|
```js
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
69
|
+
import { Viewer, License, HtmlViewOptions } from '@groupdocs/groupdocs.viewer'
|
|
70
|
+
|
|
71
|
+
// Apply license if you have one (optional for evaluation)
|
|
72
|
+
const license = new License()
|
|
73
|
+
license.setLicense('GroupDocs.Viewer.lic')
|
|
74
|
+
|
|
75
|
+
// Create a viewer for the source document
|
|
76
|
+
const viewer = new Viewer('sample.docx')
|
|
77
|
+
|
|
78
|
+
// Configure HTML output options
|
|
79
|
+
const viewOptions = HtmlViewOptions.forEmbeddedResources('page_{0}.html')
|
|
80
|
+
|
|
81
|
+
// Render the document
|
|
32
82
|
viewer.view(viewOptions)
|
|
83
|
+
|
|
84
|
+
// Exit the process
|
|
85
|
+
process.exit(0)
|
|
33
86
|
```
|
|
34
87
|
|
|
88
|
+
#### Render PDF to PNG
|
|
35
89
|
|
|
36
|
-
|
|
90
|
+
This code example shows how to render a PDF document to a set of PNG images (one image per page).
|
|
37
91
|
|
|
38
92
|
```js
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const
|
|
93
|
+
import { Viewer, License, PngViewOptions } from '@groupdocs/groupdocs.viewer'
|
|
94
|
+
|
|
95
|
+
// Apply license if you have one (optional for evaluation)
|
|
96
|
+
const license = new License()
|
|
97
|
+
license.setLicense('GroupDocs.Viewer.lic')
|
|
43
98
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
security.setPermissions(permissions.ALLOW_ALL ^ permissions.DENY_PRINTING);
|
|
99
|
+
// Create a viewer for the source document
|
|
100
|
+
const viewer = new Viewer('sample.pdf')
|
|
47
101
|
|
|
48
|
-
|
|
49
|
-
|
|
102
|
+
// Configure PNG output options (use {0} as page number placeholder)
|
|
103
|
+
const viewOptions = new PngViewOptions('page_{0}.png')
|
|
104
|
+
|
|
105
|
+
// Render all pages to PNG images
|
|
106
|
+
viewer.view(viewOptions)
|
|
107
|
+
|
|
108
|
+
// Exit the process
|
|
109
|
+
process.exit(0)
|
|
50
110
|
```
|
|
51
111
|
|
|
112
|
+
#### Render specific pages
|
|
113
|
+
|
|
114
|
+
This code example shows how to render only selected pages of a document.
|
|
115
|
+
|
|
116
|
+
```js
|
|
117
|
+
import { Viewer, License, PngViewOptions } from '@groupdocs/groupdocs.viewer'
|
|
118
|
+
import java from 'java'
|
|
119
|
+
|
|
120
|
+
// Apply license if you have one (optional for evaluation)
|
|
121
|
+
const license = new License()
|
|
122
|
+
license.setLicense('GroupDocs.Viewer.lic')
|
|
123
|
+
|
|
124
|
+
// Create a viewer for the source document
|
|
125
|
+
const viewer = new Viewer('sample.docx')
|
|
126
|
+
|
|
127
|
+
// Configure output options (for example, render selected pages to PNG images)
|
|
128
|
+
const viewOptions = new PngViewOptions('page_{0}.png')
|
|
129
|
+
|
|
130
|
+
// Render only pages 1, 3, and 5
|
|
131
|
+
const pages = java.newArray('int', [1, 3, 5])
|
|
132
|
+
viewer.view(viewOptions, pages)
|
|
133
|
+
|
|
134
|
+
// Exit the process
|
|
135
|
+
process.exit(0)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Troubleshooting
|
|
139
|
+
|
|
140
|
+
- **Download during installation fails (corporate proxy/firewall)**: Ensure your environment allows downloading the required JAR during `postinstall`. If needed, download the file manually to the `lib/` directory as described in the [Installation Guide](https://docs.groupdocs.com/viewer/nodejs-java/installation/).
|
|
141
|
+
- **Java not found**: Make sure Java (JRE 8+) is installed and available on your system `PATH`.
|
|
142
|
+
- **Permission issues when writing output files**: Verify your process has write access to the target directory.
|
|
143
|
+
|
|
144
|
+
## Licensing
|
|
145
|
+
|
|
146
|
+
For testing without trial limitations, you can request a 30-day Temporary License:
|
|
147
|
+
|
|
148
|
+
- Visit the [Get a Temporary License](https://purchase.groupdocs.com/temporary-license/) page
|
|
149
|
+
- Login with your company email address
|
|
150
|
+
- Request a temporary license and get it in your mailbox
|
|
151
|
+
|
|
152
|
+
After you receive the license file, save it locally and use it in your application as follows:
|
|
153
|
+
|
|
154
|
+
```js
|
|
155
|
+
import { License } from '@groupdocs/groupdocs.viewer';
|
|
156
|
+
|
|
157
|
+
// Apply license
|
|
158
|
+
const license = new License();
|
|
159
|
+
license.setLicense('GroupDocs.Viewer.lic');
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
This product is licensed under the GroupDocs End User License Agreement (EULA). For pricing information, visit the [GroupDocs.Viewer for Node.js via Java pricing page](https://purchase.groupdocs.com/pricing/viewer/nodejs-java/).
|
|
163
|
+
|
|
164
|
+
## Support
|
|
165
|
+
|
|
166
|
+
GroupDocs provides unlimited free technical support for all of its products. Support is available to all users, including evaluation. The support is provided at [Free Support Forum](https://forum.groupdocs.com/), [Paid Support Helpdesk](https://helpdesk.groupdocs.com/) and [Paid Consulting](https://consulting.groupdocs.com/).
|
|
167
|
+
|
|
168
|
+
### Free Support Forum
|
|
169
|
+
|
|
170
|
+
The [GroupDocs Free Support Forum](https://forum.groupdocs.com/) is available to all users and provides:
|
|
171
|
+
- Human support by the product team
|
|
172
|
+
- No time limitations on support requests
|
|
173
|
+
- Access to historical solutions and discussions
|
|
174
|
+
|
|
175
|
+
### Paid Support Helpdesk
|
|
176
|
+
|
|
177
|
+
The [Paid Support Helpdesk](https://helpdesk.groupdocs.com/) offers:
|
|
178
|
+
- Higher priority response times
|
|
179
|
+
- Dedicated support team
|
|
180
|
+
- Extended support hours
|
|
181
|
+
- Priority issue resolution
|
|
182
|
+
|
|
183
|
+
### Paid Consulting
|
|
184
|
+
|
|
185
|
+
We can work together with you on your project and develop a part or complete application. If you need new features in the existing GroupDocs product or to create API for new file formats, send us a request at [consulting.groupdocs.com/contact](https://consulting.groupdocs.com/contact/).
|
|
186
|
+
|
|
187
|
+
---
|
|
52
188
|
|
|
53
|
-
|
|
189
|
+
| [Product Home](https://products.groupdocs.com/viewer/nodejs-java/) | [Documentation](https://docs.groupdocs.com/viewer/nodejs-java/) | [Blog](https://blog.groupdocs.com/category/viewer/) | [API Reference](https://apireference.groupdocs.com/viewer/nodejs-java/) | [Code Samples](https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-Node.js-via-Java) | [Free Support](https://forum.groupdocs.com/c/viewer) | [Temporary License](https://purchase.groupdocs.com/temporary-license/) | [Pricing](https://purchase.groupdocs.com/pricing/viewer/nodejs-java/) |
|
|
54
190
|
|
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-
|
|
15
|
-
console.warn('\x1b[33m%s\x1b[0m', `File groupdocs-viewer-nodejs-
|
|
14
|
+
if (!checkFileExists(path.join(__dirname, 'lib/groupdocs-viewer-nodejs-25.12.jar'))) {
|
|
15
|
+
console.warn('\x1b[33m%s\x1b[0m', `File groupdocs-viewer-nodejs-25.12.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
|
@@ -1,152 +1,158 @@
|
|
|
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-viewer-nodejs-
|
|
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) {
|
|
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
|
-
});
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
exports.readBytesFromStream = function (readStream, callback) {
|
|
47
|
-
const inputStreamBuffer = new exports.StreamBuffer()
|
|
48
|
-
readStream.on('data', chunk => {
|
|
49
|
-
inputStreamBuffer.write(chunk)
|
|
50
|
-
})
|
|
51
|
-
readStream.on('end', () => {
|
|
52
|
-
const array = Array.from(inputStreamBuffer.toByteArray())
|
|
53
|
-
const javaArray = java.newArray('byte', array)
|
|
54
|
-
callback(javaArray)
|
|
55
|
-
})
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
exports.License = java.import("com.groupdocs.viewer.License");
|
|
59
|
-
exports.Metered = java.import("com.groupdocs.viewer.Metered");
|
|
60
|
-
exports.Viewer = java.import("com.groupdocs.viewer.Viewer");
|
|
61
|
-
exports.ViewerSettings = java.import("com.groupdocs.viewer.ViewerSettings");
|
|
62
|
-
exports.FileCache = java.import("com.groupdocs.viewer.caching.FileCache");
|
|
63
|
-
exports.CacheableFactory = java.import("com.groupdocs.viewer.caching.extra.CacheableFactory");
|
|
64
|
-
exports.DefaultTemporaryFileManager = java.import("com.groupdocs.viewer.common.tempfiles.DefaultTemporaryFileManager");
|
|
65
|
-
exports.DocumentSavingArgs = java.import("com.groupdocs.viewer.domain.documents.converting.tohtml.utils.DocumentSavingArgs");
|
|
66
|
-
exports.ArchiveSecurityException = java.import("com.groupdocs.viewer.exception.ArchiveSecurityException");
|
|
67
|
-
exports.FileNotFoundException = java.import("com.groupdocs.viewer.exception.FileNotFoundException");
|
|
68
|
-
exports.GroupDocsException = java.import("com.groupdocs.viewer.exception.GroupDocsException");
|
|
69
|
-
exports.GroupDocsViewerException = java.import("com.groupdocs.viewer.exception.GroupDocsViewerException");
|
|
70
|
-
exports.IncorrectPasswordException = java.import("com.groupdocs.viewer.exception.IncorrectPasswordException");
|
|
71
|
-
exports.
|
|
72
|
-
exports.
|
|
73
|
-
exports.
|
|
74
|
-
exports.
|
|
75
|
-
exports.
|
|
76
|
-
exports.
|
|
77
|
-
exports.
|
|
78
|
-
exports.
|
|
79
|
-
exports.
|
|
80
|
-
exports.
|
|
81
|
-
exports.
|
|
82
|
-
exports.
|
|
83
|
-
exports.
|
|
84
|
-
exports.
|
|
85
|
-
exports.
|
|
86
|
-
exports.
|
|
87
|
-
exports.
|
|
88
|
-
exports.
|
|
89
|
-
exports.
|
|
90
|
-
exports.
|
|
91
|
-
exports.
|
|
92
|
-
exports.
|
|
93
|
-
exports.
|
|
94
|
-
exports.
|
|
95
|
-
exports.
|
|
96
|
-
exports.
|
|
97
|
-
exports.
|
|
98
|
-
exports.
|
|
99
|
-
exports.
|
|
100
|
-
exports.
|
|
101
|
-
exports.
|
|
102
|
-
exports.
|
|
103
|
-
exports.
|
|
104
|
-
exports.
|
|
105
|
-
exports.
|
|
106
|
-
exports.
|
|
107
|
-
exports.
|
|
108
|
-
exports.
|
|
109
|
-
exports.
|
|
110
|
-
exports.
|
|
111
|
-
exports.
|
|
112
|
-
exports.
|
|
113
|
-
exports.
|
|
114
|
-
exports.
|
|
115
|
-
exports.
|
|
116
|
-
exports.
|
|
117
|
-
exports.
|
|
118
|
-
exports.
|
|
119
|
-
exports.
|
|
120
|
-
exports.
|
|
121
|
-
exports.
|
|
122
|
-
|
|
123
|
-
exports.
|
|
124
|
-
exports.
|
|
125
|
-
exports.
|
|
126
|
-
|
|
127
|
-
exports.
|
|
128
|
-
exports.
|
|
129
|
-
exports.
|
|
130
|
-
exports.
|
|
131
|
-
exports.
|
|
132
|
-
exports.
|
|
133
|
-
exports.
|
|
134
|
-
exports.
|
|
135
|
-
exports.
|
|
136
|
-
exports.
|
|
137
|
-
exports.
|
|
138
|
-
exports.
|
|
139
|
-
exports.
|
|
140
|
-
|
|
141
|
-
exports.
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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-viewer-nodejs-25.12.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) {
|
|
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
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
exports.readBytesFromStream = function (readStream, callback) {
|
|
47
|
+
const inputStreamBuffer = new exports.StreamBuffer()
|
|
48
|
+
readStream.on('data', chunk => {
|
|
49
|
+
inputStreamBuffer.write(chunk)
|
|
50
|
+
})
|
|
51
|
+
readStream.on('end', () => {
|
|
52
|
+
const array = Array.from(inputStreamBuffer.toByteArray())
|
|
53
|
+
const javaArray = java.newArray('byte', array)
|
|
54
|
+
callback(javaArray)
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
exports.License = java.import("com.groupdocs.viewer.License");
|
|
59
|
+
exports.Metered = java.import("com.groupdocs.viewer.Metered");
|
|
60
|
+
exports.Viewer = java.import("com.groupdocs.viewer.Viewer");
|
|
61
|
+
exports.ViewerSettings = java.import("com.groupdocs.viewer.ViewerSettings");
|
|
62
|
+
exports.FileCache = java.import("com.groupdocs.viewer.caching.FileCache");
|
|
63
|
+
exports.CacheableFactory = java.import("com.groupdocs.viewer.caching.extra.CacheableFactory");
|
|
64
|
+
exports.DefaultTemporaryFileManager = java.import("com.groupdocs.viewer.common.tempfiles.DefaultTemporaryFileManager");
|
|
65
|
+
exports.DocumentSavingArgs = java.import("com.groupdocs.viewer.domain.documents.converting.tohtml.utils.DocumentSavingArgs");
|
|
66
|
+
exports.ArchiveSecurityException = java.import("com.groupdocs.viewer.exception.ArchiveSecurityException");
|
|
67
|
+
exports.FileNotFoundException = java.import("com.groupdocs.viewer.exception.FileNotFoundException");
|
|
68
|
+
exports.GroupDocsException = java.import("com.groupdocs.viewer.exception.GroupDocsException");
|
|
69
|
+
exports.GroupDocsViewerException = java.import("com.groupdocs.viewer.exception.GroupDocsViewerException");
|
|
70
|
+
exports.IncorrectPasswordException = java.import("com.groupdocs.viewer.exception.IncorrectPasswordException");
|
|
71
|
+
exports.InvalidFontFormatException = java.import("com.groupdocs.viewer.exception.InvalidFontFormatException");
|
|
72
|
+
exports.InvalidImageFormatException = java.import("com.groupdocs.viewer.exception.InvalidImageFormatException");
|
|
73
|
+
exports.LicenseException = java.import("com.groupdocs.viewer.exception.LicenseException");
|
|
74
|
+
exports.NotSupportedException = java.import("com.groupdocs.viewer.exception.NotSupportedException");
|
|
75
|
+
exports.PasswordRequiredException = java.import("com.groupdocs.viewer.exception.PasswordRequiredException");
|
|
76
|
+
exports.FolderFontSource = java.import("com.groupdocs.viewer.fonts.FolderFontSource");
|
|
77
|
+
exports.FontSettings = java.import("com.groupdocs.viewer.fonts.FontSettings");
|
|
78
|
+
exports.FontStyles = java.import("com.groupdocs.viewer.fonts.FontStyles");
|
|
79
|
+
exports.WordProcessingSubstitutedFontInfo = java.import("com.groupdocs.viewer.fonts.WordProcessingSubstitutedFontInfo");
|
|
80
|
+
exports.ConsoleLogger = java.import("com.groupdocs.viewer.logging.ConsoleLogger");
|
|
81
|
+
exports.FileLogger = java.import("com.groupdocs.viewer.logging.FileLogger");
|
|
82
|
+
exports.ViewerLogger = java.import("com.groupdocs.viewer.logging.ViewerLogger");
|
|
83
|
+
exports.ArchiveOptions = java.import("com.groupdocs.viewer.options.ArchiveOptions");
|
|
84
|
+
exports.ArchiveSecurityOptions = java.import("com.groupdocs.viewer.options.ArchiveSecurityOptions");
|
|
85
|
+
exports.EmailOptions = java.import("com.groupdocs.viewer.options.EmailOptions");
|
|
86
|
+
exports.FileName = java.import("com.groupdocs.viewer.options.FileName");
|
|
87
|
+
exports.JpgViewOptions = java.import("com.groupdocs.viewer.options.JpgViewOptions");
|
|
88
|
+
exports.LoadOptions = java.import("com.groupdocs.viewer.options.LoadOptions");
|
|
89
|
+
exports.MailStorageOptions = java.import("com.groupdocs.viewer.options.MailStorageOptions");
|
|
90
|
+
exports.OutlookOptions = java.import("com.groupdocs.viewer.options.OutlookOptions");
|
|
91
|
+
exports.PdfOptimizationOptions = java.import("com.groupdocs.viewer.options.PdfOptimizationOptions");
|
|
92
|
+
exports.PdfOptions = java.import("com.groupdocs.viewer.options.PdfOptions");
|
|
93
|
+
exports.PdfViewOptions = java.import("com.groupdocs.viewer.options.PdfViewOptions");
|
|
94
|
+
exports.Permissions = java.import("com.groupdocs.viewer.options.Permissions");
|
|
95
|
+
exports.PngViewOptions = java.import("com.groupdocs.viewer.options.PngViewOptions");
|
|
96
|
+
exports.PresentationOptions = java.import("com.groupdocs.viewer.options.PresentationOptions");
|
|
97
|
+
exports.ProjectManagementOptions = java.import("com.groupdocs.viewer.options.ProjectManagementOptions");
|
|
98
|
+
exports.SearchHighlightOptions = java.import("com.groupdocs.viewer.options.SearchHighlightOptions");
|
|
99
|
+
exports.Security = java.import("com.groupdocs.viewer.options.Security");
|
|
100
|
+
exports.Size = java.import("com.groupdocs.viewer.options.Size");
|
|
101
|
+
exports.TextOptions = java.import("com.groupdocs.viewer.options.TextOptions");
|
|
102
|
+
exports.Tile = java.import("com.groupdocs.viewer.options.Tile");
|
|
103
|
+
exports.VisioRenderingOptions = java.import("com.groupdocs.viewer.options.VisioRenderingOptions");
|
|
104
|
+
exports.Watermark = java.import("com.groupdocs.viewer.options.Watermark");
|
|
105
|
+
exports.WebDocumentOptions = java.import("com.groupdocs.viewer.options.WebDocumentOptions");
|
|
106
|
+
exports.WordProcessingOptions = java.import("com.groupdocs.viewer.options.WordProcessingOptions");
|
|
107
|
+
exports.ArchiveViewInfoImpl = java.import("com.groupdocs.viewer.results.ArchiveViewInfoImpl");
|
|
108
|
+
exports.AttachmentImpl = java.import("com.groupdocs.viewer.results.AttachmentImpl");
|
|
109
|
+
exports.CadViewInfoImpl = java.import("com.groupdocs.viewer.results.CadViewInfoImpl");
|
|
110
|
+
exports.CharacterImpl = java.import("com.groupdocs.viewer.results.CharacterImpl");
|
|
111
|
+
exports.FileInfoImpl = java.import("com.groupdocs.viewer.results.FileInfoImpl");
|
|
112
|
+
exports.LayerImpl = java.import("com.groupdocs.viewer.results.LayerImpl");
|
|
113
|
+
exports.LayoutImpl = java.import("com.groupdocs.viewer.results.LayoutImpl");
|
|
114
|
+
exports.LineImpl = java.import("com.groupdocs.viewer.results.LineImpl");
|
|
115
|
+
exports.LotusNotesViewInfoImpl = java.import("com.groupdocs.viewer.results.LotusNotesViewInfoImpl");
|
|
116
|
+
exports.MboxViewInfoImpl = java.import("com.groupdocs.viewer.results.MboxViewInfoImpl");
|
|
117
|
+
exports.OutlookViewInfoImpl = java.import("com.groupdocs.viewer.results.OutlookViewInfoImpl");
|
|
118
|
+
exports.PageImpl = java.import("com.groupdocs.viewer.results.PageImpl");
|
|
119
|
+
exports.PdfViewInfoImpl = java.import("com.groupdocs.viewer.results.PdfViewInfoImpl");
|
|
120
|
+
exports.ProjectManagementViewInfoImpl = java.import("com.groupdocs.viewer.results.ProjectManagementViewInfoImpl");
|
|
121
|
+
exports.Resource = java.import("com.groupdocs.viewer.results.Resource");
|
|
122
|
+
exports.TextElementImpl = java.import("com.groupdocs.viewer.results.TextElementImpl");
|
|
123
|
+
exports.ViewInfoImpl = java.import("com.groupdocs.viewer.results.ViewInfoImpl");
|
|
124
|
+
exports.WordImpl = java.import("com.groupdocs.viewer.results.WordImpl");
|
|
125
|
+
exports.MemoryCleaner = java.import("com.groupdocs.viewer.utils.MemoryCleaner");
|
|
126
|
+
|
|
127
|
+
exports.FileType = java.import("com.groupdocs.viewer.FileType");
|
|
128
|
+
exports.CacheKeys = java.import("com.groupdocs.viewer.caching.CacheKeys");
|
|
129
|
+
exports.TemporaryFileManagerFactory = java.import("com.groupdocs.viewer.common.tempfiles.TemporaryFileManagerFactory");
|
|
130
|
+
exports.Image2DFormat = java.import("com.groupdocs.viewer.drawing.Image2DFormat");
|
|
131
|
+
exports.FontFormat = java.import("com.groupdocs.viewer.fonts.FontFormat");
|
|
132
|
+
exports.SearchOption = java.import("com.groupdocs.viewer.fonts.SearchOption");
|
|
133
|
+
exports.CadOptions = java.import("com.groupdocs.viewer.options.CadOptions");
|
|
134
|
+
exports.Field = java.import("com.groupdocs.viewer.options.Field");
|
|
135
|
+
exports.HtmlViewOptions = java.import("com.groupdocs.viewer.options.HtmlViewOptions");
|
|
136
|
+
exports.ImageQuality = java.import("com.groupdocs.viewer.options.ImageQuality");
|
|
137
|
+
exports.PageSize = java.import("com.groupdocs.viewer.options.PageSize");
|
|
138
|
+
exports.Position = java.import("com.groupdocs.viewer.options.Position");
|
|
139
|
+
exports.Resolution = java.import("com.groupdocs.viewer.options.Resolution");
|
|
140
|
+
exports.Rotation = java.import("com.groupdocs.viewer.options.Rotation");
|
|
141
|
+
exports.SpreadsheetOptions = java.import("com.groupdocs.viewer.options.SpreadsheetOptions");
|
|
142
|
+
exports.TextOverflowMode = java.import("com.groupdocs.viewer.options.TextOverflowMode");
|
|
143
|
+
exports.TimeUnit = java.import("com.groupdocs.viewer.options.TimeUnit");
|
|
144
|
+
exports.ViewInfoOptions = java.import("com.groupdocs.viewer.options.ViewInfoOptions");
|
|
145
|
+
exports.PathUtils = java.import("com.groupdocs.viewer.utils.PathUtils");
|
|
146
|
+
|
|
147
|
+
exports.StreamBuffer = class StreamBuffer {
|
|
148
|
+
constructor() {
|
|
149
|
+
const self = java.newInstanceSync('com.groupdocs.viewer.utils.StreamBuffer')
|
|
150
|
+
|
|
151
|
+
self.write = function (chunk) {
|
|
152
|
+
const array = Array.from(chunk)
|
|
153
|
+
const javaArray = java.newArray('byte', array)
|
|
154
|
+
self.__proto__.write.call(self, javaArray, 0, javaArray.length)
|
|
155
|
+
}
|
|
156
|
+
return self
|
|
157
|
+
}
|
|
158
|
+
}
|
package/package.json
CHANGED
|
@@ -1,35 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@groupdocs/groupdocs.viewer",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Powerful, high-performance
|
|
3
|
+
"version": "25.12.0",
|
|
4
|
+
"description": "Document viewer API for Node.js (powered by Java). Powerful, high-performance, cross-platform library for building 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/
|
|
7
|
+
"postinstall": "curl -H 'Cache-Control:no-cache' https://releases.groupdocs.com/java/repo/com/groupdocs/groupdocs-viewer-nodejs/25.12/groupdocs-viewer-nodejs-25.12.jar > lib/groupdocs-viewer-nodejs-25.12.jar"
|
|
8
8
|
},
|
|
9
9
|
"keywords": [
|
|
10
|
-
"
|
|
10
|
+
"groupdocs",
|
|
11
|
+
"groupdocs-viewer",
|
|
12
|
+
"document-viewer",
|
|
13
|
+
"file-viewer",
|
|
11
14
|
"viewer",
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
15
|
+
"document",
|
|
16
|
+
"render",
|
|
17
|
+
"preview",
|
|
18
|
+
"conversion",
|
|
19
|
+
"pdf",
|
|
20
|
+
"word",
|
|
21
|
+
"doc",
|
|
22
|
+
"docx",
|
|
23
|
+
"powerpoint",
|
|
24
|
+
"ppt",
|
|
25
|
+
"pptx",
|
|
26
|
+
"excel",
|
|
27
|
+
"xls",
|
|
28
|
+
"xlsx",
|
|
29
|
+
"csv",
|
|
30
|
+
"html",
|
|
31
|
+
"image",
|
|
32
|
+
"jpg",
|
|
33
|
+
"jpeg",
|
|
34
|
+
"png",
|
|
35
|
+
"svg"
|
|
28
36
|
],
|
|
29
37
|
"author": "Aspose",
|
|
30
38
|
"license": "End User License Agreement.html",
|
|
31
39
|
"dependencies": {
|
|
32
|
-
"java": "^0.
|
|
40
|
+
"java": "^0.18.0"
|
|
33
41
|
},
|
|
34
42
|
"directories": {
|
|
35
43
|
"lib": "lib"
|