Powerful
Choose faithful Canvas rendering or real selectable PDF text. Control page breaks, headers, footers and watermarks.
Compare rendering modesTurn your Vue components into PDFs in the browser. Choose Canvas fidelity or selectable text, then add pagination, Vue header and footer slots, watermarks, custom font, chart, SVG and image quality controls, preview and download when your app needs them.
One package for Vue 3 and Nuxt 3/4, with guides that take you from a first export to a custom document.
Choose faithful Canvas rendering or real selectable PDF text. Control page breaks, headers, footers and watermarks.
Compare rendering modesUse the Html2Pdf component or composable in Vue 3 and Nuxt 3/4. Add Vue slots and typed options as your workflow grows.
Explore the component APIStyle your exported content and theme the built-in preview and loader. PDF engines load when generation needs them.
Customize your PDF and UIUse one Vue-oriented API across visual Canvas exports and selectable-text PDFs, with SSR-safe imports, multiple output formats and export-only customization.
Use real PDF text for reports, invoices and documents where selection, search, copy and crisp typography matter.
Wait for browser fonts, embed supported TTF/OTF files in selectable text and capture chart canvases for export.
Choose SVG preparation and opt into image DPI, JPEG quality, transparency and repeated-image reuse.
Render logical pages incrementally instead of depending on one giant document-height canvas.
Generate the PDF once, then consume it as Blob, ArrayBuffer, raw Base64 or a PDF data URL without re-rendering.
SSR-safe package imports with browser-side generation guidance for ClientOnly, lazy loading and hydration-safe Nuxt apps.
Cancel long-running exports and expose stage, percentage, currentPage and totalPages for useful progress UI.
Configure typed header and footer objects, render custom Vue slots, target pages and add page numbering.
Control container and table-row breaks, repeat table headings and insert existing PDF pages before or after generated pages.
Add text, image or trusted HTML watermarks with design presets, foreground or background placement, opacity, rotation and page targeting.
Passwords, permissions, metadata and jsPDF stream compression are available across supported rendering workflows.
Preserve anchors as real PDF link annotations, including selectable link text in text rendering mode.
Use data-pdf-ignore and export styling APIs without permanently mutating the live application DOM.
Use the same generation flow for Blob output, in-app preview, downloads and browser printing in Canvas or text mode.
Apply page/body backgrounds, classes, inline styles, themes and per-page customization only to the export copy.
Blob remains the browser-friendly default. The package also exposes ArrayBuffer and Base64 serialization from the generated Blob without running the renderer a second time.
Recommended default for browser downloads, previews and large PDFs.
Convenient for storage, upload pipelines and binary application APIs.
Useful for transport and embedding when text serialization is required.
Both modes keep the same component flow for Blob output, preview, download, print and post-processing.
Best for highly visual layouts, gradients, shadows, transforms and browser-styled documents. Paginated documents can use the incremental page-by-page Canvas path.
Read Canvas guidanceBest for reports and text-heavy documents where selection, Ctrl/Cmd + F, copy and crisp text are important. Some advanced browser CSS can render differently.
Read text-mode guidanceThe performance work covers page-bounded Canvas rendering, static footer reuse, repeated-image caching, cancellation, cleanup, browser yielding, memory isolation and stress regressions.
Real non-empty incremental exports verified.
~99.96M px giant capture → ~1.74M px page-sized capture in the benchmark fixture.
Footer without logo after render-once reuse optimization.
Measured output-size reduction after static footer reuse.
50-page and 100-page Canvas exports are verified in the current regression suite. 100 pages is a tested range, not a hard package limit; real limits depend on content, images, renderer, security, browser memory and device resources.
<script setup lang="ts">
import { ref } from 'vue'
import { Html2Pdf } from 'vue-pdf-export'
import 'vue-pdf-export/style.css'
const pdfRef = ref<InstanceType<typeof Html2Pdf> | null>(null)
</script>
<template>
<button @click="pdfRef?.generatePdf()">Generate PDF</button>
<Html2Pdf ref="pdfRef" render-mode="canvas" manual-pagination>
<template #pdf-content>
<h1>My report</h1>
</template>
</Html2Pdf>
</template>Start with the component, then choose the output and rendering behavior your document needs.
Install vue-pdf-export, render your content in the #pdf-content slot, and call generatePdf() through a component ref. See the Vue 3 quick start and installation steps.
Yes. Set render-mode="text" to create selectable, searchable body text. The default Canvas mode favors browser layout fidelity and paints the body as page images. Compare the rendering modes.
Yes. Imports are SSR safe, and generation runs in the browser after mounting. The Nuxt 3 and Nuxt 4 guide covers ClientOnly and client event patterns.
Yes. The composition options prepend or append whole pages from existing PDF sources. They do not edit arbitrary content inside those pages. See PDF page composition.
Thank you to the people and projects that helped make this package possible.
Selectable-text rendering is based on and adapted from @timkozlov/html-to-pdf. The vendored source remains under its original MIT license notice.