Copy

Installation

Install the ESM package and import its public browser API.

ON_THIS_PAGE
  1. Import from the package root
  2. Browser requirements
  3. Next step

Choose your package manager and install the package.

Package manager
npm install @imggion/html2realpdf

Import from the package root

Use the public root export. Do not import files from dist.

import {
  createRenderer,
  renderPdf,
  type RenderOptions,
} from "@imggion/html2realpdf";

The package is ESM. It ships its TypeScript declarations, Worker module, WebAssembly binary, and PDF preview assets.

Browser requirements

Rendering uses browser APIs. The default renderer needs these features:

  • DOM APIs
  • WebAssembly
  • Web Workers
  • Blob and object URLs

The package can be imported while a framework renders on the server. Do not call renderPdf or createRenderer on the server.

unsupported

Node.js rendering is not part of the public API. Use a browser surface for the render call.

Next step

Continue with the quick start, or open the Next.js guide for a client component example.

ON_THIS_PAGE
  1. Import from the package root
  2. Browser requirements
  3. Next step
html2realpdf documentationCopyright © Imggion
DOCUMENTATION_TREE