API

Footers

When enabled, the footer is applied to every PDF page. Header-style selective page targeting is not exposed as a separate footer API.

Footer

When enabled, the footer is applied to every PDF page. Header-style selective page targeting is not exposed as a separate footer API.

<Html2Pdf
  :inject-footer="true"
  :footer-height="58"
  footer-mode="html"
  footer-text="My Company"
  footer-template="Page {n} of {total}"
/>

If injectFooter is false, the package does not reserve footer-specific bottom space. Any explicit bottom margin supplied through htmlToPdfOptions.margin remains.

<Html2Pdf
  :inject-footer="true"
  footer-mode="html"
  footer-html="<strong>My Company</strong>"
  footer-template="Page {n} of {total}"
/>

When footerHtml is non-empty in HTML mode, it takes precedence over footerText.

footerHtml is intentionally trusted HTML. Do not pass unsanitized user input.

<Html2Pdf
  :inject-footer="true"
  footer-mode="text"
  footer-text="My Company"
  footer-template="Page {n} of {total}"
/>

In selectable-text mode, footer text and the page-number template are emitted as selectable PDF text.

Footer logos are enabled by default.

<Html2Pdf
  :inject-footer="true"
  :footer-logo-enabled="false"
  footer-mode="text"
  footer-text="Text-only footer"
/>
<Html2Pdf
  :inject-footer="true"
  :footer-logo-enabled="true"
  footer-logo-url="/wide-logo.png"
  :footer-logo-width="150"
  :footer-logo-height="30"
/>

The logo keeps its original aspect ratio.

Default logo box:

26 × 26 CSS pixels

Supported placeholders:

{n}
{total}

Example:

Page {n} of {total}

Output:

Page 2 of 5

The footer template is the package's built-in page-numbering mechanism. There is no separate dedicated page-numbering API.

The old prop remains supported:

<Html2Pdf :use-footer-component="true" />

Prefer:

<Html2Pdf footer-mode="html" />

or:

<Html2Pdf footer-mode="text" />

When footerMode is explicitly provided, it takes priority over useFooterComponent.

PropTypeDefaultDescription
injectFooterbooleanfalseEnable footer rendering.
footerHeightnumber58Footer height in the current jsPDF unit.
footerMode`'html' \'text'`compatibility-resolved
footerTextstring''Plain-text footer content / HTML-mode fallback.
footerHtmlstring''Trusted HTML footer content.
footerTemplatestringPage {n} of {total}Page number/footer template.
footerLogoEnabledbooleantrueShow/hide footer logo.
footerLogoUrlstring''Logo URL.
footerLogoDataUrlstring''Logo data URL/base64.
footerLogoWidthnumber26Maximum logo width in CSS pixels.
footerLogoHeightnumber26Maximum logo height in CSS pixels.
footerBackgroundColorstring#F8F9FAFooter background.
footerTextColorstring#5F6368Footer text/fallback color.
useFooterComponentbooleantrueDeprecated compatibility option.
Copyright © 2026