Skip to content

how to use useVuePdfEmbed ? #230

Answered by hrynko
thethreedays asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @thethreedays,

The following is the minimal example of using the useVuePdfEmbed composable and displaying the number of pages:

<script setup>
import VuePdfEmbed, { useVuePdfEmbed } from 'vue-pdf-embed'

const { doc } = useVuePdfEmbed({ source: '<PDF_SOURCE>' })
</script>

<template>
  <p v-if="doc">Pages: {{ doc.numPages }}</p>
  <VuePdfEmbed :source="doc" />
</template>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hrynko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants