Socket
Socket
Sign inDemoInstall

vue-pdf-embed

Package Overview
Dependencies
104
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vue-pdf-embed

PDF embed component for Vue 2 and Vue 3


Version published
Weekly downloads
29K
decreased by-20.46%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

📄 vue-pdf-embed

PDF embed component for Vue 2 and Vue 3

npm npm GitHub Repo stars npm

Compatibility

This package is compatible with both Vue 2 and Vue 3, but is delievered in separate builds. Use dist/vue2-pdf-embed.js for Vue 2 and dist/vue3-pdf-embed.js for Vue 3. The default export of the package is for Vue 3.

Usage

<template>
  <div>
    <h1>File</h1>

    <vue-pdf-embed :source="source1" />

    <h1>Base64</h1>

    <vue-pdf-embed :source="source2" />
  </div>
</template>

<script>
import VuePdfEmbed from 'vue-pdf-embed'

// OR THE FOLLOWING IMPORT FOR VUE 2
// import VuePdfEmbed from 'vue-pdf-embed/dist/vue2-pdf-embed'

export default {
  components: {
    VuePdfEmbed,
  },
  data() {
    return {
      source1: '<PDF_URL>',
      source2: {
        data: atob('<BASE64_ENCODED_PDF>'),
      },
    }
  }
})
</script>

Props

NameTypeAccepted valuesDescription
pagenumber1 to the number of the last pagenumber of the page to display (displays all pages if not specified)
sourcestring
object
document URL or typed array pre-filled with datasource of the document to display

Events

NameValueDescription
loading-failederror objectfailed to load document
password-requestedcallback function, retry flagpassword is needed to display the document
rendering-failederror objectfailed to render document
renderedfinished rendering the document

Examples

Basic Usage Demo (JSFiddle)

Advanced Usage Demo (JSFiddle)

License

MIT License. Please see LICENSE file for more information.

Keywords

FAQs

Last updated on 04 Jun 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc