@@ -20,26 +20,22 @@ Client/Server Side PDF-Generator based in PDFKit
2020- ** ✅ Write in Typescript and Builded with [ ESBuild] ( https://github.com/evanw/esbuild ) **
2121- ** ✅ Browser STDLib**
2222- ** ✅ Custom Fonts && Purge Unused Fonts**
23+ - ** ✅ [ Nuxt] ( ./packages/nuxt ) & [ Vue] ( ./packages/vue ) Support**
2324- ** ✅ Plugins Ready!**
2425
25- ## Installation
26+ ## Setup
2627
2728``` shell
2829npm i pdfeasy
2930```
3031
31- ## Simple Example
32-
3332``` ts
34- import pdfeasy , { Utils } from ' pdfeasy'
35- // import pdfeasy, { Utils } from 'pdfeasy/dist/client.cjs.js'
36- // import pdfeasy, { Utils } from 'pdfeasy/dist/node.esm.js'
37- // import pdfeasy, { Utils } from 'pdfeasy/dist/node.cjs.js'
33+ import pdfeasy from ' pdfeasy'
3834
3935pdfeasy .new ()
4036
4137pdfeasy .add ([
42- { raw: ' Simple text !' },
38+ { raw: ' PDFEasy !' },
4339])
4440
4541pdfeasy .run ({
@@ -49,23 +45,73 @@ pdfeasy.run({
4945 const iframe = document .querySelector (' #pdf' ) as HTMLIFrameElement
5046
5147 iframe .src = blob
52- }).catch ((err : any ) => {
53- console . error ( err )
48+ }).catch ((err ) => {
49+ // ...
5450})
5551```
5652
53+ ### [ Vue] ( ./packages/vue )
54+
55+ ``` shell
56+ npm i vue-pdfeasy
57+ ```
58+
59+ ``` ts
60+ import { PDFPlugin } from ' vue3-pdfeasy' ;
61+
62+ const app = createApp (App );
63+ app .use (PDFPlugin );
64+ app .mount (' #app' );
65+
66+ // ...
67+
68+ < script setup >
69+ import { usePDF } from ' vue3-pdfeasy' ;
70+
71+ const pdf = usePDF ()
72+
73+ // ...
74+ < / script >
75+ ```
76+
77+ ### [ Nuxt] ( ./packages/nuxt )
78+
79+ ``` bash
80+ npm i nuxt-pdfeasy
81+ ```
82+
83+ ``` js
84+ // nuxt.config.ts
85+ modules: [
86+ ' nuxt-pdfeasy'
87+ ]
88+ ```
89+
90+ ``` ts
91+ < script setup >
92+ import { useNuxtApp } from ' #app' ;
93+
94+ const { $pdf } = useNuxtApp ()
95+ // ...
96+ < / script >
97+ ```
98+
5799## Content
58100
59101``` ts
60102pdfeasy .add ([
61103 ... Utils .content (), // Utils for debug
62- { raw: ' Hello PDFEasy!' , text: { font: ' Roboto' }}, // text with custom font,
63- { raw: ' https://i.imgur.com/path.png' , image: {}}, // external image
104+ { raw: ' Hello PDFEasy!' , text: { font: ' Roboto' } }, // text with custom font,
105+ { raw: ' https://i.imgur.com/path.png' , image: {} }, // external image
64106 { stack: [ // stack for paragraph's
65- { raw: ' A ' , text: {}},
66- { raw: ' Simple' , text: { bold: true , italic: true }},
67- { raw: ' Stack!' , text: {}},
107+ { raw: ' A ' , text: {} },
108+ { raw: ' Simple' , text: { bold: true , italic: true } },
109+ { raw: ' Stack!' , text: {} },
68110 ]},
111+ { pageBreak: {} }, // page break
112+ { lineBreak: {} }, // line break
113+ { raw: ' A checkbox!' , checkbox: {} }, // checkbox
114+ { raw: ' A list!' , list: { style: ' circle' } }, // list
69115])
70116```
71117
@@ -166,7 +212,7 @@ pdfeasy.addFonts([
166212
167213## Resources
168214
169- See [ source demo] ( ./packages/pdfeasy/ demo ) for more explanations
215+ See [ source demo] ( ./demo ) for more explanations
170216
171217See [ examples] ( ./packages/pdfeasy/examples/ ) for .pdf results.
172218
0 commit comments