PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
The open-source Vue 3 UI layer of the ComPDFKit Web SDK. View, annotate, edit, and sign PDF documents in the browser — fully customizable through
instance.UI.
ComPDFKit WebViewer UI is the open-source UI layer that sits on top of the ComPDFKit Web SDK Core engine (@compdfkit/core). It is built with Vue 3 and Pinia, and ships as a complete, responsive interface for working with PDF documents in the browser.
The interface is made of modular components — headers, ribbon groups, grouped items, buttons, panels, popups and modals. Every part can be hidden, replaced, rearranged or extended at runtime through the instance.UI API, without changing the UI source.
Integrator's page
└─ webviewer.js / webviewer.global.js (bootstrap: ComPDFKitViewer(options, element))
└─ <iframe src="{uiPath}index.html"> (WebViewer UI: Vue 3 + Pinia; uiPath defaults to {path}webviewer/)
└─ instance = { Core, UI }
└─ @compdfkit/core (DocumentViewer, AnnotationManager, Document …)
└─ Web Worker (webviewer/lib/PDFWorker.js) + WASM (ComPDFKit.wasm)The Core engine (@compdfkit/core with its Web Worker and WASM) is closed source. The UI layer (@compdfkit/webviewer, packages/webviewer in the source repository) documented here is open source: you can read, modify and rebuild it. See Building from source.
npm install @compdfkit_pdf_sdk/webviewerCopy the webviewer folder of the package to the static assets of your app, then embed the viewer in your own page:
import ComPDFKitViewer from "@compdfkit_pdf_sdk/webviewer";
const viewer = document.getElementById('webviewer');
ComPDFKitViewer({
path: '/',
initialDoc: 'Your PDF Url',
licenseKey: 'Input your license here'
}, viewer).then((instance) => {
const { UI, Core } = instance;
UI.setLanguage('en'); // Localization
UI.setTheme('dark'); // Theming
UI.disableElements(['printButton', 'downloadButton']); // Hide buttons
Core.documentViewer.addEventListener('documentLoaded', () => {
console.log('document loaded');
});
});See Getting Started.
instance object, multiple viewers.instance.Core: the Core namespace plus this viewer's documentViewer and annotationManager.instance.UI and the source folders.setToolbarGroup.addPanel, setPanels, getPanels.openElement, closeElements, disableElements, enableElements.setTheme, setCustomStyle.setLanguage, setTranslations, addLanguage, supported locales.addCustomModal.annotationPopup, textPopup, contentEditPopup, snippingToolPopup, contextMenuPopup.setToolMode, registerTool.instance.UI / instance.Core surface.src/
├── apis/ # Public API surface → instance.UI
├── instance/ # Instance assembly: options, stores, i18n, hotkeys, mounting, cleanup
├── core/ # Thin per-instance wrappers over @compdfkit/core
├── components/ # Vue components (App, modular, panels, popups, modals, overlays, document)
├── stores/ # Pinia stores (viewer, document, settings), one set per instance
├── event-listeners/ # Core events → store updates
├── helpers/ # Utilities and feature flows
├── composables/ # Vue composables
├── constants/ # dataElements, tool names, panel names, events, features
├── i18n/ # Per-instance i18next setup
└── styles/ # Base styles