Events
| Event | Payload | Description |
|---|---|---|
annotation-click | AnnotationClickPayload | Fired when an annotation is clicked. |
error | PdfError | Fired when the document fails to load or render. |
form-change | FormChangePayload | Fired when an interactive form field changes. |
link-click | LinkClickPayload | Fired when an internal or external link is activated. |
loaded | PdfDocumentMeta | Fired once the document's metadata is available. |
loading-progress | LoadingProgress | Fired as the document downloads. |
page-change | number | Fired 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. |
rendered | number | Fired after a page finishes rendering. |
rotation-change | Rotation | Fired when the rotation changes. |
search-result | SearchResult | Fired 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)"
/>