What is this
just a beautiful vue3 supported pdf viewer
Usage
Install
npm install just-pdf-viewer
Import
import { createApp } from 'vue'
import JustPdfViewer from 'just-pdf-viewer';
import App from './App.vue';
import 'just-pdf-viewer/es/index.css';
const app = createApp(App);
app.use(JustPdfViewer);
app.mount('#app');
Use in vue
<script setup lang="ts">
import {ref} from "vue";
const downloadable = ref<boolean>(true)
const rotatable = ref<boolean>(true)
const printable = ref<boolean>(true)
const scalable = ref<boolean>(true)
const lazyLoad = ref<boolean>(false)
</script>
<template>
<just-pdf-viewer src="/test.pdf" width="100vw" height="100vh" :rotatable="rotatable" :scalable="scalable" :lazy-load="lazyLoad"/>
</template>
<style scoped>
</style>
API
<just-pdf-viewer> Props
name | description | type | default value | version |
---|---|---|---|---|
width | Specify viewer's width | string | -- | 1.0.0 |
height | Specify viewer's height | string | -- | 1.0.0 |
src | Specify viewer's pdf resource src | string | URL | TypedArray | ArrayBuffer | DocumentInitParameters | -- | 1.0.0 |
rotatable | Specify whether it can rotate | boolean | true | 1.0.0 |
scalable | Specify whether it can scale | boolean | true | 1.0.0 |
lazy-load | Specify whether it renders all or not | boolean | true | 1.0.0 |
DocumentInitParameters
@see#getDocument