
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
vue-pdf-embed
Advanced tools
PDF embed component for Vue 2 and Vue 3
This package is compatible with both Vue 2 and Vue 3. The default exported build is for Vue 3, but dist
directory also contains a build for Vue 2 (dist/vue2-pdf-embed.js
). See the example in Usage section.
Depending on the environment, the package can be installed in one of the following ways:
npm install vue-pdf-embed
yarn add vue-pdf-embed
<script src="https://unpkg.com/vue-pdf-embed"></script>
<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>
Name | Type | Accepted values | Description |
---|---|---|---|
page | number | 1 to the number of the last page | number of the page to display (displays all pages if not specified) |
source | string object | document URL or typed array pre-filled with data | source of the document to display |
Name | Value | Description |
---|---|---|
loading-failed | error object | failed to load document |
password-requested | callback function, retry flag | password is needed to display the document |
rendering-failed | error object | failed to render document |
rendered | – | finished rendering the document |
Advanced Usage Demo (JSFiddle)
MIT License. Please see LICENSE file for more information.
FAQs
PDF embed component for Vue
The npm package vue-pdf-embed receives a total of 48,313 weekly downloads. As such, vue-pdf-embed popularity was classified as popular.
We found that vue-pdf-embed demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.