Skip to main content

Install Nuxt PDF

Add server-side PDF rendering to an existing Nuxt 4 application.

Nuxt PDF is a Nuxt module. It does not require a separate service or CLI.

Check the requirements

LayerSupported versions
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 outside the current support boundary.

Add the module

Install the package:

Terminal
pnpm add @lupinum/nuxt-pdf

Add it to nuxt.config.ts:

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

Use a coding agent

A coding agent is a development tool that can inspect and change your project. After installation, copy this prompt into your coding agent:

Add Nuxt PDF to this Nuxt application and render one PDF from a Vue template.
Read the project's existing instructions first. Resolve
@lupinum/nuxt-pdf/agent-docs from this application's directory and read its
starting pages. Use the installed version's examples and public types. Preserve
existing routes, security limits, conventions, and AGENTS.md instructions. Add
or update one short Nuxt PDF pointer in AGENTS.md if the project allows it; do
not duplicate the documentation. If the file is absent, create only that
pointer. Report missing guidance. Verify the server route, PDF output, and one
invalid request.

If the installed package has no agent-docs export, read its packaged README, types, and CONFORMANCE.md. Use documentation from the matching source tag when more detail is needed. Installing or updating the package does not edit project instructions. The pointer resolves the installed package, so upgrades and rollbacks select the matching documentation without copying it into your application.

The module now discovers Vue templates under pdfs/, generates the typed server-only #pdf registry, and adds the /_pdf development preview.

If your editor does not recognize #pdf after installation, run pnpm nuxt prepare once. Nuxt also refreshes the generated types when the development server starts.

Continue with Render your first PDF.

Add test dependencies later

The optional test entry uses pdfjs-dist for semantic inspection and @napi-rs/canvas for raster comparisons. Install them only when you start testing PDF output:

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

The testing guide shows the complete workflow.