# @kevin-skylabx/vue-pdf-embed-skylabx

> PDF embed component for Vue 2 and Vue 3

Latest version **1.0.6** (published 2021-11-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @kevin-skylabx/vue-pdf-embed-skylabx
pnpm add @kevin-skylabx/vue-pdf-embed-skylabx
yarn add @kevin-skylabx/vue-pdf-embed-skylabx
bun add @kevin-skylabx/vue-pdf-embed-skylabx
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2021-11-29 |
| First published | 2021-11-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.4 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | kevin-skylabx |
| Maintainers | kevin-skylabx |
| Keywords | vue, vuejs, pdf |

## Links

- npm: https://www.npmjs.com/package/@kevin-skylabx/vue-pdf-embed-skylabx
- Repository: https://github.com/kevinflou/vue-pdf-embed
- Homepage: https://github.com/kevinflou/vue-pdf-embed#readme
- Issues: https://github.com/kevinflou/vue-pdf-embed/issues
- npm.io page: https://npm.io/package/@kevin-skylabx/vue-pdf-embed-skylabx

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 1.0.6 (latest) — 2021-11-29

## README

# 📄 vue-pdf-embed

PDF embed component for Vue 2 and Vue 3

[![Awesome](https://raw.githubusercontent.com/sindresorhus/awesome/main/media/mentioned-badge.svg)](https://github.com/vuejs/awesome-vue)
[![npm](https://img.shields.io/npm/v/vue-pdf-embed)](https://npmjs.com/package/vue-pdf-embed)
[![npm](https://img.shields.io/npm/dm/vue-pdf-embed)](https://npmjs.com/package/vue-pdf-embed)
[![GitHub Repo stars](https://img.shields.io/github/stars/hrynko/vue-pdf-embed)](https://github.com/hrynko/vue-pdf-embed)
[![npm](https://img.shields.io/npm/l/vue-pdf-embed)](https://github.com/hrynko/vue-pdf-embed/blob/master/LICENSE)

## Compatibility

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](#usage) section.

## Installation

Depending on the environment, the package can be installed in one of the following ways:

```shell
npm install vue-pdf-embed
```

```shell
yarn add vue-pdf-embed
```

```html
<script src="https://unpkg.com/vue-pdf-embed"></script>
```

## Usage

```vue
<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

| 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` <br> `object` | document URL or typed array pre-filled with data | source of the document to display                                   |

### Events

| 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            |

## Examples

[Basic Usage Demo (JSFiddle)](https://jsfiddle.net/hrynko/ct6p8r7k)

[Advanced Usage Demo (JSFiddle)](https://jsfiddle.net/hrynko/we7p5uq4)

## License

MIT License. Please see [LICENSE file](LICENSE) for more information.

---
_Source: https://npm.io/package/@kevin-skylabx/vue-pdf-embed-skylabx · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
