API

Loader, Progress, Events & Slots

Loader & Progress

Built-in loader

<Html2Pdf :show-loader="true" loader-text="Generating PDF..." />

Disable it:

<Html2Pdf :show-loader="false" />

Numeric progress

<Html2Pdf @progress="onProgress" />
function onProgress(value: number) {
  console.log(value)
}

This is generation-stage progress, not byte-level network progress.

Rich progress stages

<Html2Pdf @progress-stage="onProgressStage" />
import type { PdfProgressState } from 'vue-pdf-export'

function onProgressStage(state: PdfProgressState) {
  console.log(state.stage, state.progress)
}

Current stages:


idle

pagination

images

preparing

rendering

watermark

header

footer

metadata

serializing

complete

error

Custom loader

<Html2Pdf>
  <template #loader="{ progress, loading, stage, progressState }">
    <div v-if="loading">
      {{ stage }} - {{ progress }}%
    </div>
  </template>
</Html2Pdf>

Slot values:

ValueType
progressnumber
loadingboolean
stagePdfProgressStage
progressStatePdfProgressState

Events

<Html2Pdf
  @progress="onProgress"
  @progress-stage="onProgressStage"
  @startPagination="onStartPagination"
  @hasPaginated="onPaginated"
  @beforeDownload="onBeforeDownload"
  @hasDownloaded="onDownloaded"
  @closed="onClosed"
  @error="onError"
/>
EventPayloadDescription
progressnumberNumeric generation progress.
progressStage / @progress-stagePdfProgressStateNamed stage and progress.
startPaginationnonePagination started.
hasPaginatednonePagination completed.
beforeDownloadBeforeDownloadPayloadEmitted before generation.
hasDownloadedBlobGenerated Blob is available.
closednonePreview/generation flow closed.
errorErrorGeneration or print error.

Slots

SlotRequiredDescription
pdf-contentyesHTML converted to PDF.
loadernoCustom loader with { progress, loading, stage, progressState }.
Copyright © 2026