Skip to content

Files

Latest commit

Feb 7, 2025
dd42259 · Feb 7, 2025

History

History

vue

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Aug 16, 2024
May 12, 2023
May 17, 2023
Feb 7, 2025
May 12, 2023
May 12, 2023

Vue PDFEasy

A PDFEasy plugin for Vue 3.x

Install

npm i vue-pdfeasy

Example

//...
import { PDFPlugin } from 'vue-pdfeasy';
//...
const app = createApp(App);
app.use(PDFPlugin);
app.mount('#app');

// ...

<template>
  <iframe id="pdf" />
</template>

<script setup lang="ts">
import { usePDF } from 'vue-pdfeasy'

const pdf = usePDF()

pdf.new()

pdf.add([
  { raw: 'Simple text!' },
])

pdf.run({
  type: 'client',
  clientEmit: 'blob'
}).then((blob) => {
  const iframe = document.querySelector('#pdf')

  iframe.src = blob
}).catch((err) => {
  console.error(err)
})
</script>