Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blank output #2

Open
sh00nyan opened this issue May 7, 2023 · 1 comment
Open

blank output #2

sh00nyan opened this issue May 7, 2023 · 1 comment

Comments

@sh00nyan
Copy link

sh00nyan commented May 7, 2023

I just tried this package and followed the README/demo, but getting blank page in the output.

I am not sure if I am supposed to pass any options inside pdf.createPdf() method.

Sharing the stackblitz link
https://stackblitz.com/edit/vitejs-vite-q2br2u

@Novout
Copy link
Member

Novout commented May 7, 2023

The generation example was improved, and now in the 2.2.0 version it is possible to install the fonts provided by pdfmake by default, making it easier to understand how to use it.

It will probably solve your problem:

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

For more information, see the PDFMake 0.3x documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants