Skip to content

betterwrite/vue-pdfmake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

May 7, 2023
4618d54 · May 7, 2023

History

41 Commits
May 7, 2023
May 7, 2023
Sep 25, 2021
Sep 25, 2021
Sep 25, 2021
May 7, 2023
Sep 25, 2021
May 7, 2023
May 7, 2023
May 7, 2023
May 7, 2023
May 7, 2023
May 7, 2023
May 7, 2023

Repository files navigation

Vue PDFMake

A PDFMake plugin for 3.x

Install

yarn add vue3-pdfmake

OR

npm install vue3-pdfmake

in main.(js|ts)

import { createApp } from 'vue';
import { PDFPlugin } from 'vue3-pdfmake';
import App from './App.vue';

const app = createApp(App);
//...
app.use(PDFPlugin);
//...
app.mount('#app');

Example

<script setup>
import { usePDF } from 'vue3-pdfmake';

const pdfmake = usePDF({
  autoInstallVFS: true
})

const onGenPDF = () => {
  pdfmake.createPdf({
    content: [
      'Hello World From PDFMake!',
    ]
  }).download();
}
</script>

<template>
  <button @click="onGenPDF">Click here for download demo pdf</button>
</template>

Documentation

Check PDFMake Documentation for more explanations!