vue-pdfjs-demo

Simple PDF viewer
1,520
Install
npm install vue-pdfjs-demo
Latest Version:1.1.9
Vue:2
License:MIT
Last Updated:Apr 1, 2020
Links: npm
Maintainer: jcheneaux

vue-pdfjs-demo

This project demonstrates how a simple PDF viewer could be implemented using Vue and PDF.js. This is not a fully-featured PDF document viewer with sophisticated controls, but could serve as the basis for one.

To learn more, checkout the series of posts describing how this project was implemented.

  1. Basic page rendering
  2. Fetching and rendering lazily
  3. Extracting a data component
  4. Refactoring to nested abstract components

Setup

To install the plugin inside your project :

$ npm install vue-pdfjs-demo

Then, copy this code where you want inside you project :

<template>

  <VuePdfJs class="grey"
            :url="url"
  />

</template>

<script>
import VuePdfJs from "vue-pdfjs-demo/src/App.vue";

export default {
  components: {
    VuePdfJs
  },
    data: () => ({
    url:'https://cors-anywhere.herokuapp.com/YourUrl.pdf'
  })
}
</script>

Some details still need to be fixed. For example :

  • Backgrounds
  • icons
  • css styles

Documentation

Version History

Version Released Vue License
1.1.9 ^2.6.11 MIT
1.1.8 ^2.6.11 MIT
1.1.7 ^2.6.11 MIT
1.1.6 ^2.6.11 MIT
1.1.5 ^2.6.11 MIT