Api
TypeScript
Use the TypeScript declarations and public types shipped by vue-pdf-export for PDF outputs, component options, events, headers, footers and watermark configuration.
The package ships TypeScript declarations.
Common types:
import type {
BeforeDownloadPayload,
FooterMode,
FooterOptions,
GeneratePdfResult,
HeaderOptions,
Html2CanvasOptions,
Html2PdfOptions,
Html2PdfProps,
JsPdfOptions,
PdfAutoFitOptions,
PdfBase64Options,
PdfEncryptionOptions,
PdfFormat,
PdfGenerationCompletePayload,
PdfGenerationMetrics,
PdfImageOptions,
PdfMargin,
PdfMetadataOptions,
PdfOrientation,
PdfOutputFormat,
PdfPageBreakOptions,
PdfPageContext,
PdfPageTarget,
PdfPermission,
PdfProgressStage,
PdfProgressState,
PdfRenderMode,
PdfSecurityOptions,
PdfSerializedOutput,
PdfStyle,
PdfStylingOptions,
WatermarkLayer,
WatermarkMode,
WatermarkOptions,
WatermarkType,
} from 'vue-pdf-export'
Render mode type:
export type PdfRenderMode = 'canvas' | 'text'
Output types:
export type PdfOutputFormat = 'blob' | 'arraybuffer' | 'base64'
export interface PdfBase64Options {
dataUrl?: boolean
}
export type PdfSerializedOutput = Blob | ArrayBuffer | string
Useful helpers:
import {
createPdfOptions,
normalizePdfFilename,
pdfBlobToArrayBuffer,
pdfBlobToBase64,
resolvePdfPages,
serializePdfOutput,
} from 'vue-pdf-export'
Filename Normalization
import { normalizePdfFilename } from 'vue-pdf-export'
normalizePdfFilename('invoice:/customer?2026')
// invoice--customer-2026.pdf
Normalization:
- adds exactly one
.pdfextension - prevents duplicate
.pdf - sanitizes unsafe filename/path characters
- trims trailing dots and spaces
- falls back to a timestamp for empty names
- protects Windows reserved device names such as
CONandLPT1 - preserves Unicode
- limits excessively long base names
Examples:
normalizePdfFilename('report')
// report.pdf
normalizePdfFilename('report.PDF')
// report.pdf
normalizePdfFilename('CON')
// _CON.pdf
Loader, Progress, Metrics, Events & Slots
Build custom vue-pdf-export UI with loaders, progress state, generation metrics, component events and slots for PDF content and user-defined loading experiences.
Full README Reference
Read the complete vue-pdf-export package reference, including installation, rendering modes, API options, output formats, styling and production guidance.
