Updated version to change onRendered to onOnPdfInit?: ((pdf: PDFDocumentProxy) => any) | undefined; if you want to get the total page numbers after initialization:
template
<PDF
src="xxx"
@on-pdf-init="handlePdfInit"
/>
script
/**
*
* @param {import('pdf-vue3').PDFDocumentProxy} pdf - The PDF document proxy object.
* @returns {void}
*/
const handlePdfInit = (pdf) => {
console.log(pdf.numPages);
};
Updated version to change
onRendered
toonOnPdfInit?: ((pdf: PDFDocumentProxy) => any) | undefined;
if you want to get the total page numbers after initialization:template
script
API:https://github.com/hymhub/pdf-vue3#events