API

API Reference

Public vue-pdf-export component props, methods, events, slots, composable and types, with links to detailed guides.

Import the public component, composable and CSS:

The v1.3.0 fonts, autoOptimize, svgMode and watermark design APIs are covered in the media and typography guide and watermark guide. For an earlier installation, use its versioned full reference.

import { Html2Pdf, useHtml2Pdf } from 'vue-pdf-export'
import 'vue-pdf-export/style.css'

Component props

AreaPropsDetails
OutputenableDownload (true), previewModal (false), filename (timestamp fallback)Preview/download
RendererrenderMode ('canvas'), pdfQuality (2), pdfFormat ('a4'), pdfOrientation ('portrait'), pdfContentWidth ('800px')Rendering modes, paper formats
LayoutshowLayout (false), floatLayout (false)Component
PaginationmanualPagination (false), optional paginateElementsByHeight, paginationDebug (false)Smart pagination
Layersheader?: HeaderOptions, footer?: FooterOptions, watermark?: WatermarkOptionsHeaders, footers, watermarks
Compositioncomposition?: PdfCompositionOptions, pdfTemplate?, templatePosition?Composition
Stylingstyling, pageBackground, bodyBackground, pageClass, bodyClass, pageStyle, bodyStylePDF styling
Documentsecurity, metadata, compress, htmlToPdfOptionsSecurity, metadata, core props
UI / telemetryshowLoader (true), loaderText, collectMetrics (false)Events and slots

The original direct injectHeader, header-*, injectFooter, footer-*, footerMode, and useFooterComponent props remain accepted. An explicitly set object field takes priority over its matching direct prop; omitted object fields fall back to direct props. See the compatibility guidance and mapping, or the earlier v1 headers and footers guides.

Methods and output

generatePdf({ composition? }?) returns Promise<Blob>. generatePdfArrayBuffer() returns Promise<ArrayBuffer>. generatePdfBase64({ dataUrl? }?) returns raw Base64 or a PDF data URL. print(), closePreview(), resetPagination(), and cancelGeneration() control the browser flow. See programmatic API. Exported helpers include pdfBlobToArrayBuffer, pdfBlobToBase64, serializePdfOutput, normalizePdfFilename, createPdfOptions, resolvePdfPages, paginateElement and resetPagination.

Events and slots

EventPayload
progress, progressStage, generationCompleteNumber, PdfProgressState, PdfGenerationCompletePayload
startPagination, hasPaginatedNo payload
paginationBreak, paginationWarning, paginationCompletePdfPaginationDiagnostic, same, PdfPaginationDiagnostic[]; debug mode only
beforeDownload, hasDownloaded, closed, errorBeforeDownloadPayload, Blob, none, Error

#pdf-content supplies body content; #loader supplies progress UI; #pdf-header and #pdf-footer receive pageNumber, totalPages, and orientation. See events and slots.

Public types

import type {
  HeaderOptions, FooterOptions, PdfCompositionOptions, PdfTemplateSource,
  PdfPaginationDiagnostic, PdfPaginationDiagnosticType, PdfPageTarget,
  Html2PdfProps, Html2PdfOptions, PdfRenderMode, PdfFormat, PdfOrientation,
  PdfBase64Options, PdfOutputFormat, PdfSerializedOutput, PdfSecurityOptions,
  PdfMetadataOptions, WatermarkOptions, PdfProgressState,
} from 'vue-pdf-export'

The TypeScript guide lists the remaining public type exports. Internal slot resolvers and renderer staging details are not consumer-facing options.

Copyright © 2026