Selectable & searchable text
Use real PDF text for reports, invoices and documents where selection, search, copy and crisp typography matter.
A Vue + TypeScript browser PDF package with Canvas fidelity, selectable/searchable text, pagination, large-document rendering, cancellation, page-aware progress, headers, footers, watermarks, security, metadata, links and more.
Use one Vue-oriented API across visual Canvas exports and selectable-text PDFs, while keeping access to advanced html2pdf.js, html2canvas and jsPDF configuration.
Use real PDF text for reports, invoices and documents where selection, search, copy and crisp typography matter.
Paginated Canvas exports render one logical page at a time instead of depending on one giant document-height canvas.
Cancel long-running exports and expose stage, percentage, currentPage and totalPages to build useful progress UI.
Plain text or trusted HTML, optional logos, page-aware header targeting and built-in Page {n} of {total} numbering.
Text or image watermarks, foreground/background layers, repeat mode, opacity, rotation, positioning and selected pages.
User and owner passwords, permissions, password parts, metadata and jsPDF stream compression in both render modes.
Preserve anchors as real PDF link annotations, including selectable link text in text rendering mode.
Per-generation image caching avoids re-encoding the same reusable image source across selectable-text documents.
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 guidance →Best 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 guidance →The 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">
<template #pdf-content>
<h1>My report</h1>
</template>
</Html2Pdf>
</template>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.