We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I get the total number of pages in a PDF
The text was updated successfully, but these errors were encountered:
They have an example in the docs 😁 @time202051 Hope this helps!
<template> <div class="test-pdf flex flex-col"> <h1 class="text-lg font-bold mb-3">Test PDF</h1> <div v-if="isLoading">Loading pages...</div> <div v-else>Total pages {{pageCount}}</div> <client-only> <div class="pdf-wrapper"> <VuePdfEmbed class="pdf" ref="pdfRef" source="random.pdf" @rendered="handleDocumentRender"></VuePdfEmbed> </div> </client-only> </div> </template> <script> export default { name: 'TestPDF', data () { return { pageCount: 1, isLoading: true } }, methods: { handleDocumentRender () { this.isLoading = false this.pageCount = this.$refs.pdfRef.pageCount } } } </script>
Sorry, something went wrong.
@bogdan12893 thanks for your comment!
Another option would be to use the loaded event value (there will be a numPages property inside)
loaded
numPages
No branches or pull requests
How do I get the total number of pages in a PDF
The text was updated successfully, but these errors were encountered: