Get Started

Migration Guide

Move from direct header and footer props to typed objects and Vue slots while keeping access to earlier vue-pdf-export documentation.

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 prop1.2.0 object field
injectHeader, headerHeight, headerPagesheader.enabled, .height, .pages
headerText, headerHtmlheader.text, .html
headerLogoEnabled, headerLogoUrl, headerLogoDataUrlheader.showLogo, .logoUrl, .logoDataUrl
headerLogoWidth, headerLogoHeightheader.logoWidth, .logoHeight
headerBackgroundColor, headerTextColorheader.backgroundColor, .textColor
injectFooter, footerHeight, footerTemplatefooter.enabled, .height, .template
`footerMode="htmltext", useFooterComponent`
footerText, footerHtmlfooter.text, .html
footerLogoEnabled, footerLogoUrl, footerLogoDataUrlfooter.showLogo, .logoUrl, .logoDataUrl
footerLogoWidth, footerLogoHeightfooter.logoWidth, .logoHeight
footerBackgroundColor, footerTextColorfooter.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.

Copyright © 2026