Skip to main content

Introduction

@hyzyla/pdfium is a Node.js wrapper for the PDFium library:

  • ⬇️ pdfium - an open-source library for PDF manipulation and rendering, developed by Google and used in Google Chrome browser.
  • ⬇️ pdfium-lib - project by Paulo Coutinho to compile PDFium library to multiple platforms, including WebAssembly.
  • 📍 @hyzyla/pdfium - (you are here) Node.js wrapper for the WebAssembly build of PDFium library.

Features

  • 📦 Zero dependencies - PDFium library is compiled to WebAssembly and bundled with the package.
  • 🚀 Fast - PDFium can be faster than PDF.js, because it's originally written in C++ and compiled to WebAssembly, while PDF.js is entirely written in JavaScript.
  • 🔒 Type-safe - TypeScript definitions are included.

Use cases

Main use case for this library is to render PDF files to images, but if you need to do something else with PDF files that is supported by PDFium, but not included in this library, feel free to open an issue or a pull request on GitHub.

Examples how to render PDF files to images can be found on 👉 "Render PDF to image" page.

Installation

# yarn add @hyzyla/pdfium
# pnpm install @hyzyla/pdfium
npm install @hyzyla/pdfium