PDF Generation Flow
vue-pdf-export exposes an Html2Pdf component and a useHtml2Pdf composable. The component coordinates props, slots, pagination, preview and download. The composable manages generation state, progress, cancellation and output URLs. The core prepares content and chooses a renderer; renderer modules own Canvas or selectable-text output.
From Vue content to PDF Blob
- The component resolves options and, when a positive pagination height is supplied, plans DOM page breaks. Direct composable calls provide their own prepared element and page breaks.
- Core creates a private export staging clone, applies export-only styles and ignore markers, waits for fonts and images, and prepares chart, SVG and image assets. The live Vue page is left alone.
- Selectable-text mode maps supported DOM text, shapes, images and links into PDF operations. Canvas mode captures page images, one page at a time when markers are available, or uses its classic html2pdf path otherwise.
- Page styling, watermarks, headers, footers, metadata, optional page composition and security are applied to the PDF.
- One serialized Blob feeds preview, download, print or output conversion. Cleanup releases staging content, temporary fonts and media caches; the UI later revokes its owned Blob URLs.
The public library defaults to Canvas. The playground can use its own demo defaults. Nuxt imports are SSR safe, but PDF generation needs a browser DOM. See rendering modes, pagination, media preparation and programmatic output.
For maintainers, the v1.3.0 project-flow map identifies the files and scenario traces. The editable Excalidraw diagram shows the same flow in lanes. Use the installed package version when checking consumer behavior.
Fonts, Charts, SVG and Image Optimization
Prepare Vue charts, SVG, custom fonts and images for browser PDF export. Compare Canvas and selectable-text behavior, CORS recovery and quality controls.
v1 Documentation
Vue PDF export documentation for releases up to 1.1.1, including direct header and footer props and the earlier component API.
