@docviewkit/viewer
v0.2.59
Published
Browser-local, read-only Office and PDF Viewer Web Component
Maintainers
Readme
DocViewKit Viewer
Free, high-performance, lightweight document viewing—right in your browser.
DocViewKit Viewer is a browser-local, read-only Web Component for Office, PDF, OpenDocument, iWork, WPS Office, XPS, CSV, and RTF files. It uses a compact core with on-demand format packs for fast, responsive viewing across Chrome, Edge, Firefox, and Safari. Document bytes stay in the browser.
Install
npm install @docviewkit/viewerimport "@docviewkit/viewer";
const viewer = document.querySelector("docviewkit-viewer");
await viewer.open(file);First-open performance
Configure optional formats before the first open() and start their small JavaScript dispatcher import early:
import "@docviewkit/viewer";
const formatPack = import("@docviewkit/viewer/extended-formats")
.then(({ extendedFormatPack }) => extendedFormatPack);
const viewer = document.querySelector("docviewkit-viewer");
viewer.config = { engine: { formatPack: () => formatPack } };
await viewer.open(file);Only the Wasm module matching the detected document family is then loaded. Use wps-formats or xps-formats when the product accepts only that optional family. Serve versioned runtime assets with HTTP caching, reuse the Viewer with close() between documents, and avoid preloading every Wasm module or starting all-page rendering and document-wide search before first paint.
Why DocViewKit
- Free to use: every supported format is available in the free Viewer.
- High performance: documents are parsed and rendered locally without a conversion service.
- Lightweight by design: the compact core and optional format packs keep unused capabilities out of the startup path.
- Broad compatibility: one Viewer covers modern and legacy document formats across major browser engines.
- Fast and responsive: local processing, lazy loading, and incremental rendering keep viewing interactions immediate.
- Frontend-only: the component runs entirely in the browser and requires no backend service.
- Private by default: normal viewing never uploads document bytes.
Licensing
Free Viewer requires no license and keeps the fixed DocViewKit Free brand in the status bar. Commercial licenses add white-label presentation, API text watermarks, deeper integration, and support options; Free Viewer does not render configured watermarks. Commercial plans do not unlock additional document formats.
- Online demo: https://docviewkit.com/en/demo/
- Commercial license requests: https://docviewkit.com/en/portal/
- Releases: https://github.com/docviewkit/viewer/releases
- Bug reports: https://github.com/docviewkit/viewer/issues
- Format boundaries: https://docviewkit.com/docs/supported-formats/
This package contains compiled artifacts, not product source code. See FREE_VIEWER_LICENSE.md and THIRD_PARTY_NOTICES.md. Do not attach confidential documents to public issues; follow SECURITY.md for security reports.
