Socket
Book a DemoInstallSign in
Socket

@embedpdf/pdfium

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

latest
Source
npmnpm
Version
1.1.1
Version published
Weekly downloads
6K
-27.32%
Maintainers
1
Weekly downloads
 
Created
Source
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.

Keywords

pdf

FAQs

Package last updated on 07 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts