Skip to content

Events ​

EventPayloadDescription
annotation-clickAnnotationClickPayloadFired when an annotation is clicked.
errorPdfErrorFired when the document fails to load or render.
form-changeFormChangePayloadFired when an interactive form field changes.
link-clickLinkClickPayloadFired when an internal or external link is activated.
loadedPdfDocumentMetaFired once the document's metadata is available.
loading-progressLoadingProgressFired as the document downloads.
page-changenumberFired when the active page changes.
password-incorrect–Fired when a submitted password is rejected.
password-required–Fired when the document is encrypted and a password is required.
renderednumberFired after a page finishes rendering.
rotation-changeRotationFired when the rotation changes.
search-resultSearchResultFired when the search results update.
zoom-change(zoom: ZoomValue, scale: number)Fired when the zoom changes; payload is the zoom value and the resolved scale.

In addition, the v-model bindings emit update:page / update:zoom / update:rotation when their value changes. Payload types are exported from vue-pdfz.

Example ​

vue
<PdfViewer
  @loaded="(meta) => console.log(`${meta.pageCount} pages`)"
  @error="(error) => console.error(error.code, error.message)"
  @page-change="(page) => (current = page)"
  @search-result="(r) => (count = `${r.current}/${r.total}`)"
  @form-change="(f) => console.log(f.field, f.value)"
/>