1.0.1 • Published 2 years ago

just-pdf-viewer v1.0.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

logo

Github releaseLicense

中文

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

\ Props

namedescriptiontypedefault valueversion
widthSpecify viewer's widthstring--1.0.0
heightSpecify viewer's heightstring--1.0.0
srcSpecify viewer's pdf resource srcstring | URL | TypedArray | ArrayBuffer | DocumentInitParameters--1.0.0
rotatableSpecify whether it can rotatebooleantrue1.0.0
scalableSpecify whether it can scalebooleantrue1.0.0
lazy-loadSpecify whether it renders all or notbooleantrue1.0.0

DocumentInitParameters@see#getDocument

Live Example

https://just.pdf.viewer.sdefaa.com

1.0.1

2 years ago

1.0.0

2 years ago