@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.
@@ -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://company.groupdocs.com/legal/eula" />
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: <a href="https://company.groupdocs.com/legal/eula">https://company.groupdocs.com/legal/eula</a></p>
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
- **GroupDocs.Viewer for Node.js via Java** is a high-performance and cross-platform library that allows you to build desktop and web file viewer applications. It supports over 170 document types from popular categories such as Microsoft Office, OpenOffice, AutoCAD, Photoshop, Visio, images, metafiles, programming, archives, messages, PDF & more.
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
- ## Node.js Viewer API Features
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
- ## Supported File Formats
16
- View documents in the [most popular file formats](https://docs.groupdocs.com/viewer/nodejs-java/supported-document-formats/) (DOCX, XLSX, PPTX, PDF, DWG, PSD, HTML, ZIP, and more) by rendering them as HTML, PDF, PNG, and JPEG files.
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
- From the command line:
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
- npm install @groupdocs/groupdocs.viewer
62
+ Below are simple Node.js snippets that demonstrate typical use cases.
25
63
 
26
- ### View DOCX As Responsive HTML using Node.js
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
- const viewer = new groupdocs.viewer.Viewer("sample.docx")
30
- const viewOptions = groupdocs.viewer.HtmlViewOptions.forEmbeddedResources("output-responsive.html")
31
- viewOptions.setRenderResponsive(true)
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
- ### View DOCX As Protected PDF via Node.js
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
- const viewer = new groupdocs.viewer.Viewer("sample.docx");
40
- const viewOptions = new groupdocs.viewer.PdfViewOptions("output-protect.pdf");
41
- const permissions = groupdocs.viewer.Permissions;
42
- const security = new groupdocs.viewer.Security();
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
- security.setDocumentOpenPassword("o123");
45
- security.setPermissionsPassword("p123");
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
- viewOptions.setSecurity(security);
49
- viewer.view(viewOptions);
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
- [Home](https://www.groupdocs.com/) | [Product Page](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](forum.groupdocs.com/c/viewer) | [Temporary License](https://purchase.groupdocs.com/temporary-license)
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-24.8.jar'))) {
15
- console.warn('\x1b[33m%s\x1b[0m', `File groupdocs-viewer-nodejs-24.8.jar not found in the lib directory.\nPlease navigate to the package directory:`);
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');
@@ -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-24.8.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.LicenseException = java.import("com.groupdocs.viewer.exception.LicenseException");
72
- exports.NotSupportedException = java.import("com.groupdocs.viewer.exception.NotSupportedException");
73
- exports.PasswordRequiredException = java.import("com.groupdocs.viewer.exception.PasswordRequiredException");
74
- exports.FolderFontSource = java.import("com.groupdocs.viewer.fonts.FolderFontSource");
75
- exports.FontSettings = java.import("com.groupdocs.viewer.fonts.FontSettings");
76
- exports.ConsoleLogger = java.import("com.groupdocs.viewer.logging.ConsoleLogger");
77
- exports.FileLogger = java.import("com.groupdocs.viewer.logging.FileLogger");
78
- exports.ViewerLogger = java.import("com.groupdocs.viewer.logging.ViewerLogger");
79
- exports.ArchiveOptions = java.import("com.groupdocs.viewer.options.ArchiveOptions");
80
- exports.ArchiveSecurityOptions = java.import("com.groupdocs.viewer.options.ArchiveSecurityOptions");
81
- exports.EmailOptions = java.import("com.groupdocs.viewer.options.EmailOptions");
82
- exports.FileName = java.import("com.groupdocs.viewer.options.FileName");
83
- exports.JpgViewOptions = java.import("com.groupdocs.viewer.options.JpgViewOptions");
84
- exports.LoadOptions = java.import("com.groupdocs.viewer.options.LoadOptions");
85
- exports.MailStorageOptions = java.import("com.groupdocs.viewer.options.MailStorageOptions");
86
- exports.OutlookOptions = java.import("com.groupdocs.viewer.options.OutlookOptions");
87
- exports.PdfOptimizationOptions = java.import("com.groupdocs.viewer.options.PdfOptimizationOptions");
88
- exports.PdfOptions = java.import("com.groupdocs.viewer.options.PdfOptions");
89
- exports.PdfViewOptions = java.import("com.groupdocs.viewer.options.PdfViewOptions");
90
- exports.Permissions = java.import("com.groupdocs.viewer.options.Permissions");
91
- exports.PngViewOptions = java.import("com.groupdocs.viewer.options.PngViewOptions");
92
- exports.PresentationOptions = java.import("com.groupdocs.viewer.options.PresentationOptions");
93
- exports.ProjectManagementOptions = java.import("com.groupdocs.viewer.options.ProjectManagementOptions");
94
- exports.Security = java.import("com.groupdocs.viewer.options.Security");
95
- exports.Size = java.import("com.groupdocs.viewer.options.Size");
96
- exports.TextOptions = java.import("com.groupdocs.viewer.options.TextOptions");
97
- exports.Tile = java.import("com.groupdocs.viewer.options.Tile");
98
- exports.VisioRenderingOptions = java.import("com.groupdocs.viewer.options.VisioRenderingOptions");
99
- exports.Watermark = java.import("com.groupdocs.viewer.options.Watermark");
100
- exports.WebDocumentOptions = java.import("com.groupdocs.viewer.options.WebDocumentOptions");
101
- exports.WordProcessingOptions = java.import("com.groupdocs.viewer.options.WordProcessingOptions");
102
- exports.ArchiveViewInfoImpl = java.import("com.groupdocs.viewer.results.ArchiveViewInfoImpl");
103
- exports.AttachmentImpl = java.import("com.groupdocs.viewer.results.AttachmentImpl");
104
- exports.CadViewInfoImpl = java.import("com.groupdocs.viewer.results.CadViewInfoImpl");
105
- exports.CharacterImpl = java.import("com.groupdocs.viewer.results.CharacterImpl");
106
- exports.FileInfoImpl = java.import("com.groupdocs.viewer.results.FileInfoImpl");
107
- exports.LayerImpl = java.import("com.groupdocs.viewer.results.LayerImpl");
108
- exports.LayoutImpl = java.import("com.groupdocs.viewer.results.LayoutImpl");
109
- exports.LineImpl = java.import("com.groupdocs.viewer.results.LineImpl");
110
- exports.LotusNotesViewInfoImpl = java.import("com.groupdocs.viewer.results.LotusNotesViewInfoImpl");
111
- exports.MboxViewInfoImpl = java.import("com.groupdocs.viewer.results.MboxViewInfoImpl");
112
- exports.OutlookViewInfoImpl = java.import("com.groupdocs.viewer.results.OutlookViewInfoImpl");
113
- exports.PageImpl = java.import("com.groupdocs.viewer.results.PageImpl");
114
- exports.PdfViewInfoImpl = java.import("com.groupdocs.viewer.results.PdfViewInfoImpl");
115
- exports.ProjectManagementViewInfoImpl = java.import("com.groupdocs.viewer.results.ProjectManagementViewInfoImpl");
116
- exports.Resource = java.import("com.groupdocs.viewer.results.Resource");
117
- exports.TextElementImpl = java.import("com.groupdocs.viewer.results.TextElementImpl");
118
- exports.ViewInfoImpl = java.import("com.groupdocs.viewer.results.ViewInfoImpl");
119
- exports.WordImpl = java.import("com.groupdocs.viewer.results.WordImpl");
120
- exports.MemoryCleaner = java.import("com.groupdocs.viewer.utils.MemoryCleaner");
121
- exports.StreamBuffer = java.import("com.groupdocs.viewer.utils.StreamBuffer");
122
-
123
- exports.FileType = java.import("com.groupdocs.viewer.FileType");
124
- exports.CacheKeys = java.import("com.groupdocs.viewer.caching.CacheKeys");
125
- exports.TemporaryFileManagerFactory = java.import("com.groupdocs.viewer.common.tempfiles.TemporaryFileManagerFactory");
126
- exports.SearchOption = java.import("com.groupdocs.viewer.fonts.SearchOption");
127
- exports.CadOptions = java.import("com.groupdocs.viewer.options.CadOptions");
128
- exports.Field = java.import("com.groupdocs.viewer.options.Field");
129
- exports.HtmlViewOptions = java.import("com.groupdocs.viewer.options.HtmlViewOptions");
130
- exports.ImageQuality = java.import("com.groupdocs.viewer.options.ImageQuality");
131
- exports.PageSize = java.import("com.groupdocs.viewer.options.PageSize");
132
- exports.Position = java.import("com.groupdocs.viewer.options.Position");
133
- exports.Resolution = java.import("com.groupdocs.viewer.options.Resolution");
134
- exports.Rotation = java.import("com.groupdocs.viewer.options.Rotation");
135
- exports.SpreadsheetOptions = java.import("com.groupdocs.viewer.options.SpreadsheetOptions");
136
- exports.TextOverflowMode = java.import("com.groupdocs.viewer.options.TextOverflowMode");
137
- exports.TimeUnit = java.import("com.groupdocs.viewer.options.TimeUnit");
138
- exports.ViewInfoOptions = java.import("com.groupdocs.viewer.options.ViewInfoOptions");
139
- exports.PathUtils = java.import("com.groupdocs.viewer.utils.PathUtils");
140
-
141
- exports.StreamBuffer = class StreamBuffer {
142
- constructor() {
143
- const self = java.newInstanceSync('com.groupdocs.viewer.utils.StreamBuffer')
144
-
145
- self.write = function (chunk) {
146
- const array = Array.from(chunk)
147
- const javaArray = java.newArray('byte', array)
148
- self.__proto__.write.call(self, javaArray, 0, javaArray.length)
149
- }
150
- return self
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": "24.8.0",
4
- "description": "Powerful, high-performance and cross-platform library that allows you to build desktop and web file viewer applications.",
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/24.8/groupdocs-viewer-nodejs-24.8.jar > lib/groupdocs-viewer-nodejs-24.8.jar"
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
- "view",
10
+ "groupdocs",
11
+ "groupdocs-viewer",
12
+ "document-viewer",
13
+ "file-viewer",
11
14
  "viewer",
12
- "PDF",
13
- "Word",
14
- "DOCX",
15
- "DOC",
16
- "PowerPoint",
17
- "PPT",
18
- "PPTX",
19
- "Excel",
20
- "XLS",
21
- "XLSX",
22
- "CSV",
23
- "to",
24
- "JPG",
25
- "PNG",
26
- "Spreadsheet",
27
- "SVG"
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.14.0"
40
+ "java": "^0.18.0"
33
41
  },
34
42
  "directories": {
35
43
  "lib": "lib"