JSPM

  • Created
  • Published
  • Downloads 16759
  • Score
    100M100P100Q128132F
  • License MIT

vue.js pdf viewer

Package Exports

  • vue-pdf

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vue-pdf) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

vue-pdf

vue.js pdf viewer

Install

npm install --save vue-pdf

Example

<template>
  <pdf src="./static/relativity.pdf" style="width:50%"></pdf>
</template>

<script>
import pdf from 'vue-pdf'

export default {
  components: {
    pdf
  }
}

Demo

vue-pdf demo on jsfiddle

API

props

:src String / Object

The url of the pdf file. src may also be a string|TypedArray|DocumentInitParameters|PDFDataRangeTransport for more details, see PDFJS.getDocument().

:page Number

The page number to display.

:password Function(updatePassword, reason)

  • updatePassword: The function to call with the pdf password.
  • reason: the reason why this function is called 'NEED_PASSWORD' or 'INCORRECT_PASSWORD'

events

@numPages Number

The total number of pages of the pdf.

To do

  • Simplified non-webpack integration
  • Added more advanced examples
  • Add @progress event
  • Add :rotate prop
  • Make <resize-sensor> optional (implies add a :scale prop)
  • Handle resize-sensor event throttle
  • Buy more coffee

Credits

Franck Freiburger