@ceereals/vue-pdf

Vue PDF - Create PDF documents using Vue components
20,671 128
Install
npm install @ceereals/vue-pdf
Latest Version:0.3.1
Vue:3
License:MIT
Last Updated:Apr 8, 2026
Links: GitHub  ·  npm
Maintainer: ceereals_

Installation

npm install @ceereals/vue-pdf

Usage

Web

<script setup>
import { Document, Page, Text, View, PDFViewer } from "@ceereals/vue-pdf";
import { reactive } from "vue";
const viewStyle = reactive({
  flexDirection: "row",
  justifyContent: "center",
  alignItems: "center",
  height: "100%",
});

const textStyle = reactive({
  fontSize: 24,
});
</script>
<template>
  <PDFViewer>
    <Document>
      <Page size="A4">
        <View :style="viewStyle">
          <Text :style="textStyle">Hello, Vue PDF!</Text>
        </View>
      </Page>
    </Document>
  </PDFViewer>
</template>

Node

import { Document, Page, Text, View, renderToFile } from "@ceereals/vue-pdf";
import { defineComponent, h } from "@vue/runtime-core";
import fs from "fs";

const DocumentTemplate = defineComponent(() => {
    return () => (
      h(Document, [
        h(Page, { size: "A4" }, [
          h(
            View, { style: viewStyle },
            [
              h(
                Text, { style: textStyle },
                "Hello, Vue PDF!",
              ),
            ],
          ),
        ]),
      ])
    )
})

const stream = renderToFile(DocumentTemplate,'document.pdf');

Documentation

For more information, check out the documentation.

License

MIT © Riccardo Romoli

Related Packages

@jasy/vue

Author PDFs as Vue components - a thin Vue custom renderer over @jasy/pdf.

3,305
vue-pdf-embed

PDF embed component for Vue

7,595,565 1,044
@tato30/vue-pdf

PDF component for Vue 3

2,130,711 692
vue-pdf

vue.js pdf viewer

864,848 2,295
pdfobject-vue

Official PDFObject component for Vue 3

199,735

Version History

Version Released License
0.3.1 MIT
0.3.0 MIT
0.2.1 MIT
0.2.0 MIT
0.1.3 MIT