🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@groupdocs/groupdocs.viewer

Package Overview
Dependencies
Maintainers
4
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@groupdocs/groupdocs.viewer

Document viewer API for Node.js (powered by Java). Powerful, high-performance, cross-platform library for building desktop and web file viewer applications.

latest
npmnpm
Version
26.4.0
Version published
Weekly downloads
71
102.86%
Maintainers
4
Weekly downloads
 
Created
Source

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.

  • Product Home
  • Release Notes
  • Documentation
  • System Requirements
  • Installation Guide
  • Support
  • Pricing

Key Features

  • Render documents for viewing in any web browser.
  • View pages separately, rotate/reorder pages, and add watermarks.
  • Render with embedded/external resources; customize CSS, fonts, and images.
  • Render all pages as a single PDF, or as images (PNG/JPEG).
  • Speed up loading with configurable caching.
  • Extract text and coordinates; read file info (type, pages count, etc.).
  • Auto-detect file type; replace missing fonts or use custom fonts.

Supported Formats

View documents in popular file formats (DOCX, XLSX, PPTX, PDF, DWG, PSD, HTML, ZIP, and many more).

Documents & Office

  • PDF: PDF
  • Word Processing: DOC, DOCX, RTF, TXT
  • Spreadsheet: XLS, XLSX, CSV
  • Presentation: PPT, PPTX

Other Formats

  • CAD: DWG, DXF, DGN
  • Images: JPG, PNG, SVG, TIFF
  • Email: EML, MSG, PST
  • Archives: ZIP, RAR, 7Z
  • Web: HTML

Getting Started

Prerequisites

  • Node.js (LTS recommended)
  • Java Runtime Environment (JRE) 8 or later
  • Windows, Linux, or macOS

Installation

Install the package from npm:

npm i @groupdocs/groupdocs.viewer

For detailed setup instructions, see the System Requirements and Installation documentation topics.

Use cases

Below are simple Node.js snippets that demonstrate typical use cases.

Render DOCX to HTML

This code example shows how to render a DOCX to HTML files with embedded resources.

import { Viewer, License, HtmlViewOptions } from '@groupdocs/groupdocs.viewer'

// Apply license if you have one (optional for evaluation)
const license = new License()
license.setLicense('GroupDocs.Viewer.lic')

// Create a viewer for the source document
const viewer = new Viewer('sample.docx')

// Configure HTML output options
const viewOptions = HtmlViewOptions.forEmbeddedResources('page_{0}.html')

// Render the document
viewer.view(viewOptions)

// Exit the process
process.exit(0)

Render PDF to PNG

This code example shows how to render a PDF document to a set of PNG images (one image per page).

import { Viewer, License, PngViewOptions } from '@groupdocs/groupdocs.viewer'

// Apply license if you have one (optional for evaluation)
const license = new License()
license.setLicense('GroupDocs.Viewer.lic')

// Create a viewer for the source document
const viewer = new Viewer('sample.pdf')

// Configure PNG output options (use {0} as page number placeholder)
const viewOptions = new PngViewOptions('page_{0}.png')

// Render all pages to PNG images
viewer.view(viewOptions)

// Exit the process
process.exit(0)

Render specific pages

This code example shows how to render only selected pages of a document.

import { Viewer, License, PngViewOptions } from '@groupdocs/groupdocs.viewer'
import java from 'java'

// Apply license if you have one (optional for evaluation)
const license = new License()
license.setLicense('GroupDocs.Viewer.lic')

// Create a viewer for the source document
const viewer = new Viewer('sample.docx')

// Configure output options (for example, render selected pages to PNG images)
const viewOptions = new PngViewOptions('page_{0}.png')

// Render only pages 1, 3, and 5
const pages = java.newArray('int', [1, 3, 5])
viewer.view(viewOptions, pages)

// Exit the process
process.exit(0)

Troubleshooting

  • 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.
  • Java not found: Make sure Java (JRE 8+) is installed and available on your system PATH.
  • Permission issues when writing output files: Verify your process has write access to the target directory.

Licensing

For testing without trial limitations, you can request a 30-day Temporary License:

  • Visit the Get a Temporary License page
  • Login with your company email address
  • Request a temporary license and get it in your mailbox

After you receive the license file, save it locally and use it in your application as follows:

import { License } from '@groupdocs/groupdocs.viewer';

// Apply license
const license = new License();
license.setLicense('GroupDocs.Viewer.lic');

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.

Support

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, Paid Support Helpdesk and Paid Consulting.

Free Support Forum

The GroupDocs Free Support Forum is available to all users and provides:

  • Human support by the product team
  • No time limitations on support requests
  • Access to historical solutions and discussions

Paid Support Helpdesk

The Paid Support Helpdesk offers:

  • Higher priority response times
  • Dedicated support team
  • Extended support hours
  • Priority issue resolution

Paid Consulting

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.

| Product Home | Documentation | Blog | API Reference | Code Samples | Free Support | Temporary License | Pricing |

Keywords

groupdocs

FAQs

Package last updated on 12 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts