Comments (2)
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>
from vue-pdf-embed.
@bogdan12893 thanks for your comment!
Another option would be to use the loaded
event value (there will be a numPages
property inside)
from vue-pdf-embed.
Related Issues (20)
- An error occurs when IE11 is running vue2+cli-service5 HOT 1
- using vue-pdf-embed with vue+ts+vite when rendering multi-page pdf and specify that page cannot be rendered HOT 1
- vue-pdf-embed v1.2.1 - Performance issue with large PDF files
- how use Web Worker Loading in vite
- V2 Rendering quality issues compared to 1.2.1 HOT 3
- Rendering PDF with Annotation Layer
- Rotation Causes Blinking and Memory Spike
- When printing invoices, one page of PDF will become two pages HOT 1
- node_modules/vue-pdf-embed/dist/index.mjs (3293:33): Use of eval in "node_modules/vue-pdf-embed/dist/index.mjs" is strongly discouraged as it poses security risks and may cause issues with minification. HOT 2
- "Module parse failed: Unexpected token (1:54175) File was processed with these loaders: * ./node_modules/babel-loader/lib/index.js"
- vue3 中 pdf 内容错乱 HOT 1
- The requested module 'pdfjs-dist' does not provide an export named 'PasswordResponses' HOT 3
- redundant render base64 pdf cause same canvas render multiple time error HOT 1
- Import font package not found
- Vulnerabilities HOT 1
- xiaomi phone in have this a problem t.a is not a function
- [Bug Report] Memory leaks after changing the page width
- PDF.js Critical Vulnerability HOT 5
- InvalidAccessError: Failed to set the 'responseType' property on 'XMLHttpRequest': The response type cannot be changed for synchronous requests made from a document.
- pdf加载失败 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-pdf-embed.