Migration Guide
This page collects changes between documentation versions. The version selector opens the guide for the API you have installed.
From v1 (up to 1.1.1) to v2 (1.2.0)
The v1 documentation retains the original direct-prop header and footer examples. Those settings can remain in an older installation. For the current API, group layer options in header and footer objects or provide Vue slots.
<!-- 1.1.1 and earlier -->
<Html2Pdf :inject-header="true" header-text="Quarterly report"
:inject-footer="true" footer-mode="text" footer-template="Page {n} of {total}">
<template #pdf-content><article>Report</article></template>
</Html2Pdf>
<!-- 1.2.0 and later -->
<Html2Pdf :header="{ enabled: true, text: 'Quarterly report' }"
:footer="{ enabled: true, useHtml: false, template: 'Page {n} of {total}' }"
:manual-pagination="true">
<template #pdf-content><article>Report</article></template>
</Html2Pdf>
| 1.1.1 prop | 1.2.0 object field |
|---|---|
injectHeader, headerHeight, headerPages | header.enabled, .height, .pages |
headerText, headerHtml | header.text, .html |
headerLogoEnabled, headerLogoUrl, headerLogoDataUrl | header.showLogo, .logoUrl, .logoDataUrl |
headerLogoWidth, headerLogoHeight | header.logoWidth, .logoHeight |
headerBackgroundColor, headerTextColor | header.backgroundColor, .textColor |
injectFooter, footerHeight, footerTemplate | footer.enabled, .height, .template |
| `footerMode="html | text", useFooterComponent` |
footerText, footerHtml | footer.text, .html |
footerLogoEnabled, footerLogoUrl, footerLogoDataUrl | footer.showLogo, .logoUrl, .logoDataUrl |
footerLogoWidth, footerLogoHeight | footer.logoWidth, .logoHeight |
footerBackgroundColor, footerTextColor | footer.backgroundColor, .textColor |
The current component still accepts direct header and footer props. For each corresponding field, an explicitly supplied header or footer object value takes priority; an omitted object value falls back to the direct prop. For example, header: { text: 'New title' } keeps a direct injectHeader setting, while header: { enabled: false } disables the built-in header. A Vue slot activates its layer and owns its visible markup, even when the object sets enabled: false; object height and header pages still apply.
You can keep an existing direct-prop configuration while upgrading. The object API groups new work more clearly, so migrate at your own pace and inspect a generated PDF when you change a header or footer. The v1 guides remain available for projects using the earlier release.
Next: headers, footers, smart pagination, composition, paper formats, and full API reference.
Nuxt 3 & Nuxt 4 SSR
Generate PDFs from HTML in Nuxt 3 and Nuxt 4 with vue-pdf-export. Import safely during SSR, then run Canvas or selectable-text generation in the browser.
PDF Paper Formats and Orientation
Choose supported paper sizes, custom jsPDF dimensions and portrait or landscape orientation for vue-pdf-export.
