Skip to content

juliusyolo/just-pdf-viewer

Repository files navigation

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/style.css'

const app = createApp(App);
app.use(JustPdfViewer);
app.mount('#app');

Use in vue

<script setup lang="ts">
import {ref} from "vue";
const rotatable = 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.1
height Specify viewer's height string -- 1.0.1
src Specify viewer's pdf resource src string | URL | TypedArray | ArrayBuffer | DocumentInitParameters -- 1.0.1
rotatable Specify whether it can rotate boolean true 1.0.1
scalable Specify whether it can scale boolean true 1.0.1
lazy-load Specify whether it renders all or not boolean true 1.0.1

DocumentInitParameters@see#getDocument

Live Example

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