pdf-raster

Runtime and environment

Understand supported runtimes and the native PDFium dependency model.

Supported runtimes

@omsimos/pdf-raster is designed for:

  • Node.js
  • Bun

It is not designed for:

  • browsers
  • React client components
  • Edge runtime
  • WebAssembly

Why server-side only

The package loads a native binding and a platform-specific PDFium library. That is the right tradeoff for throughput and installation simplicity on the server, but it means the package should stay on the backend side of your app.

Next.js runtime choice

In Next.js, keep @omsimos/pdf-raster inside Node.js route handlers or other server-only code. Do not run it in Edge routes.

Native dependency model

At runtime, the package needs:

  • the napi-rs native binding
  • a matching PDFium library for the current platform

In this monorepo, PDFium is cached locally and bundled during package builds.

If the library fails to initialize

See Errors and troubleshooting. If you are working on the package locally, also see Local development.

On this page