@embedpdf/pdfium
PDFium WebAssembly for the web platform. This package provides a powerful JavaScript interface to PDFium, enabling high-quality PDF rendering and manipulation directly in web applications.
Documentation
For complete documentation, examples, and API reference, please visit:
Official Documentation
What is PDFium?
PDFium is an open-source PDF rendering engine originally developed by Foxit Software and later released as open source by Google. Written in C++, it's the same engine that powers PDF viewing in Chrome and numerous other applications. This package brings native-quality PDF capabilities to the browser through WebAssembly, without requiring any server-side processing.
Features
- High-fidelity rendering of PDF pages
- Text extraction and search
- Form filling and manipulation
- Annotation support
- Digital signature verification
- PDF modification and creation
Installation
npm install @embedpdf/pdfium
pnpm add @embedpdf/pdfium
yarn add @embedpdf/pdfium
bun add @embedpdf/pdfium
Basic Usage
import { init, WrappedPdfiumModule } from '@embedpdf/pdfium';
const pdfiumWasm =
'https://cdn.jsdelivr.net/npm/@embedpdf/pdfium/dist/pdfium.wasm';
let pdfiumInstance = null;
async function initializePdfium() {
if (pdfiumInstance) return pdfiumInstance;
const response = await fetch(pdfiumWasm);
const wasmBinary = await response.arrayBuffer();
pdfiumInstance = await init({ wasmBinary });
pdfiumInstance.PDFiumExt_Init();
return pdfiumInstance;
}
async function renderPdf() {
const pdfium = await initializePdfium();
}
Learn More
Check out our comprehensive documentation at embedpdf.com/docs/pdfium for:
- Detailed API reference
- Code examples
- Best practices
- Advanced usage
License
This package is licensed under the MIT License - see the LICENSE file for details.
It also bundles PDFium in WebAssembly form,
which is licensed under the Apache License, Version 2.0.