Vue Pdf Viewer is a simple and creative pdf reader for Vue.js.
https://vue-pdf-viewer.web.app/
<Pdf file="/docs/pdf.pdf" title="My Beautiful PDF File"></Pdf>
Here you specify the location of pdf file and the title of card header.
At right top side, you see the number of pages.
<span class="right" id="PageInfo" v-if="!error">Page {{current}}/{{totalPage}}</span>
<button class="btn btn-sm btn-success mr-2" id="prev-page" @click="RenderPage(current-1)" :disabled="current <= 1"><i class="fas fa-arrow-circle-left mr-1"></i> Prev Page</button>
<button class="btn btn-sm btn-success" id="next-page" @click="RenderPage(current+1)" :disabled="totalPage<=current">Next Page <i class="fas fa-arrow-circle-right ml-1"></i></button>
In the main file “App.vue” we call our Pdf viewer like this:
<template>
<div id="app">
<Pdf file="/docs/pdf.pdf" title="My Beautiful PDF File"></Pdf>
</div>
</template>
<script>
import Pdf from '@/components/Pdf.vue'
export default {
name: 'App',
components: {
Pdf
}
}
</script>
npm install
npm run serve
npm run build
npm run lint