1.0.0 • Published 10 months ago

lwj-vite-vue-pdf v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

lwj-vite-vue-pdf

The package contains a Vue2 + vite component to easily display PDF files in Vite.

Note: This project depends on duyansoft-pdfjs-dist which is currently quite a few versions behind pdfjs-dist

Note: Make sure to manually copy pdf.worker.min.js to public/pdsjs/pdf.worker.js

Example - basic

<template>
  <pdf src="./static/relativity.pdf"></pdf>
</template>

<script>
import pdf from 'lwj-vite-vue-pdf'

export default {
  components: {
    pdf
  }
}
</script>

Install

yarn add --save lwj-vite-vue-pdf

Demo

Browser support

Same browser support as Vue.js 3 (IE via Babel I guess)

Note

  • since v2.x, the script is exported as esm.
  • This is a copy of Vue-PDF adapted to work with Vue 3

API