Introduction
vue-pdf-export is a Vue 3 HTML-to-PDF component and composable for browser applications. Use it from JavaScript or TypeScript.
These guides describe the published 1.3.0 API. If you maintain an installation through 1.1.1, use the v1 documentation. Read the full references for every published version here on the site.
The current API includes smart split controls, row-aware tables, header/footer objects and Vue slots, composition, expanded paper sizes, font readiness, chart snapshots, SVG fallback and opt-in image optimization. If your app uses direct header or footer props from an older release, see the migration guide.
It supports two rendering modes:
- Canvas mode - maximum HTML/CSS visual fidelity through
html2pdf.js+html2canvas+jsPDF. - Selectable text mode - browser-side vector PDF rendering with real selectable/searchable/copyable text, clickable PDF links, password protection, metadata, compression, page-aware headers/footers, and watermarks.
It also includes manual and automatic pagination, preview, download, native browser print, Blob/ArrayBuffer/Base64 output, export-only page/body styling, data-pdf-ignore, custom export CSS, external print stylesheets, forced light/dark themes, width auto-fit, safe filename normalization, progress stages, opt-in generation metrics, current-page progress, cancellation, page targeting, PDF permissions, SSR-safe imports, large-document optimizations, and advanced renderer configuration.
Default package behavior remains
renderMode="canvas"for backwards compatibility. The live playground may choose a different default for demonstration purposes.
Highlights
- Browser-side PDF generation with no package-managed upload service
- Canvas and selectable-text rendering
- Blob, ArrayBuffer, raw Base64, and PDF data-URL output
- Native browser print support in both rendering modes
- Incremental page-by-page Canvas rendering when page-break markers are present
- Cooperative cancellation for long-running exports
- Page-aware progress with
currentPage/totalPages - Opt-in total, stage, and per-page generation timing metrics
data-pdf-ignorefor screen-only UI that must stay out of generated PDFs- Export-only page/body styling without mutating the visible Vue DOM
- Repeated-image caching in selectable-text rendering
- Optional TTF/TrueType-outline OTF embedding for selectable text
- Export-only chart snapshots, SVG fallback and explicit image quality controls
- Text, image and trusted HTML watermark designs with per-export reuse
- Temporary DOM/canvas cleanup between expensive rendering steps
- Password protection, owner password, PDF permission flags, metadata, and compression
- Headers, footers, logos, watermarks, page targeting, and clickable links
- SSR-safe package imports with Nuxt 3 and Nuxt 4 validation
- Packed-consumer verification across npm, pnpm, Yarn, Yarn Plug'n'Play, and Bun
- Large-document stress presets from 5 through 1000 pages, plus custom counts
Presets are test inputs, not a guarantee that every page count will succeed on every device. Test representative documents in your target browsers.
