A TypeScript PDF toolkit for the browser: a PDFium/WASM engine, a framework-agnostic canvas viewer, ready-made React UI, and collaborative editing support.
React demo · Vanilla demo · API reference · Documentation

| Package | npm | Use it for |
|---|---|---|
@pdfrx/react |
npm | A ready-made React viewer, composable UI, or headless hooks. |
@pdfrx/viewer |
npm | A framework-agnostic canvas viewer or custom element. |
@pdfrx/engine |
npm | Rendering, extraction, editing, and encoding without viewer UI. |
@pdfrx/colab |
npm | Multi-user page, annotation, and form synchronization. |
@pdfrx/viewer-core |
npm | DOM-free geometry, layout, text, and selection logic. |
Higher-level packages install their lower-level dependencies automatically.
Most React applications should start with @pdfrx/react.
npm install @pdfrx/react react react-dom
import { PdfrxViewerApp } from '@pdfrx/react';
import '@pdfrx/react/styles.css';
export function App() {
return (
<PdfrxViewerApp
src="/manual.pdf"
wasmModulesUrl="/pdfium/"
style={{ height: '100dvh' }}
/>
);
}
Copy pdfium_worker.js and pdfium.wasm from
node_modules/@pdfrx/engine/assets/ into your public /pdfium/ directory.
See the @pdfrx/react README for composition and API links.
npm install @pdfrx/viewer
<script type="module">
import { definePdfrxViewerElement } from '@pdfrx/viewer';
definePdfrxViewerElement();
</script>
<pdfrx-viewer
src="/manual.pdf"
wasm-modules-url="/pdfium/"
style="width: 100%; height: 100dvh"
></pdfrx-viewer>
See the @pdfrx/viewer README for the class-based API.
Remote PDF URLs must allow browser CORS access.
Detailed behavior belongs in the topic guides and API reference.
npm install
npm run build
npm test
npm run dev:react
Other examples use npm run dev and npm run dev:colab. See
AGENTS.md for
repository workflows and release requirements.
MIT — see LICENSE.