Skip to main content

Installation

Requirements and the one-line module install for an existing Nuxt 4 app.

Nuxt PDF is a Nuxt module. It installs into an existing Nuxt 4 application and adds server-side PDF rendering; there is no separate CLI or service.

Requirements

LayerSupported
Node.js^22.14.0, ^24.0.0, or ^26.0.0
Nuxt^4.4.8
Vue^3.5.0

Nuxt 3, Node 20, browser rendering, and edge rendering are not claimed by the current alpha. The engine is Node server-only.

Install the module

pnpm
pnpm add @lupinum/nuxt-pdf

Add it to nuxt.config.ts:

nuxt.config.ts
export default defineNuxtConfig({
  modules: ["@lupinum/nuxt-pdf"],
});

The module discovers templates under pdfs/ and generates the typed #pdf registry. In development, it also mounts preview routes under /_pdf.

#pdf is a Nitro server module. The production client bundle contains neither the template SFCs nor the PDF engine, and the production server artifact omits the development preview registry, sample data, and scenarios.

After first enabling the module, restart nuxt dev (or run nuxt prepare) once so Nuxt writes the typed #pdf registry. Until that runs, #pdf imports have no types.

Optional test dependencies

The testing utilities in @lupinum/nuxt-pdf/test parse and rasterize real output through pdfjs-dist and @napi-rs/canvas. They are loaded lazily and are not runtime dependencies, so install them only when you write PDF tests:

pnpm
pnpm add -D pdfjs-dist @napi-rs/canvas

See Testing your PDFs for the full workflow.