@embedpdf/pdfium

中文文档
2.15.1发布于 2026/09/17MITTypeScriptESM + CJS零依赖近 30 天下载 522.1万

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.

原始使用文档
文档目录7 节
  1. Documentation
  2. What is PDFium?
  3. Features
  4. Installation
  5. Basic Usage
  6. Learn More
  7. License
EmbedPDF logo

EmbedPDF

NPM version License Join the community on GitHub

@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
npm install @embedpdf/pdfium

# pnpm
pnpm add @embedpdf/pdfium

# yarn
yarn add @embedpdf/pdfium

# bun
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 });

  // Initialize the PDFium extension library
  // This is required before performing any PDF operations
  pdfiumInstance.PDFiumExt_Init();

  return pdfiumInstance;
}

// Usage
async function renderPdf() {
  const pdfium = await initializePdfium();
  // Use pdfium to load and render PDFs
  // See documentation for detailed examples
}

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.

版本与发布记录

@embedpdf/pdfium 共发布 89 个版本,首次发布于 2025/03/19;过去 12 个月发布了 37 个版本。

版本发布日期距今
2.15.1latest2026/09/171 个月前
2.15.02026/08/053 个月前
2.14.42026/06/085 个月前
2.14.32026/05/205 个月前
2.14.22026/04/306 个月前
2.14.12026/04/226 个月前

其他发布通道:alpha → 1.0.0-alpha.1,next → 2.0.0-next.3。

关于 @embedpdf/pdfium 的常见问题

@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.

如何安装 @embedpdf/pdfium?

在项目目录运行 npm install @embedpdf/pdfium,或使用 pnpm add / yarn add / bun add。

@embedpdf/pdfium 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@embedpdf/pdfium 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@embedpdf/pdfium 可以商用吗?

@embedpdf/pdfium 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@embedpdf/pdfium 的下载量有多少?

根据 npm 官方下载统计,@embedpdf/pdfium 在 2026/10/14 – 2026/11/12 这 30 天内被下载 5,220,594 次,日均约 174,020 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@embedpdf/pdfium 还在维护吗?

最新版本 2.15.1 发布于 2026/09/17(1 个月前);至今共发布 89 个版本,其中过去 12 个月发布了 37 个;首次发布于 2025/03/19。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。