Getting Started

Introduction

Learn what Nuxt PDFMake does and how it builds on top of pdfmake.

Nuxt PDFMake is a Nuxt module for generating PDFs with pdfmake from both your Vue app and your Nitro server routes.

pdfmake is the PDF generation engine. It provides the document-definition format, layout system, tables, columns, images, styles, and font support that power the generated PDFs. This module focuses on the Nuxt integration layer around pdfmake.

What This Module Adds

Nuxt PDFMake handles the Nuxt-specific work needed to use pdfmake comfortably in an application:

  • A client composable: usePDFMake()
  • Server utilities: createPDFBuffer(), createPDFBase64(), and useServerPDFMake()
  • Build-time font processing for local fonts and Google Fonts
  • Shared font registration for client and server PDF generation
  • Optional CDN font descriptors for browser-side PDF creation
  • A development API route for generating PDFs from JSON
  • A Nuxt DevTools panel for inspecting configured fonts and testing PDF output

When To Use It

Use this module when your Nuxt app needs receipts, invoices, reports, certificates, exports, or any other document that should be generated as a PDF.

For browser interactions, use usePDFMake() in Vue components. For Nitro route handlers, use createPDFBuffer() or createPDFBase64() so the PDF can be returned from the server.

Credit

This project exists because of pdfmake, an open-source JavaScript library for PDF generation. If you need the full document-definition reference, layout behavior, table options, or advanced pdfmake features, the official pdfmake documentation is the source of truth.