Skip to content

Commit 33a7391

Browse files
committed
chore: example and readme
1 parent 209dac5 commit 33a7391

3 files changed

Lines changed: 15 additions & 21 deletions

File tree

README.md

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,11 @@ Client/Server Side PDF-Generator based in PDFKit
1717
<br>
1818

1919
- **✅ Client/Server Side Support**
20-
- **✅ Write in Typescript**
21-
- **✅ Builded with [ESBuild](https://github.com/evanw/esbuild) and requests with [OhMyFetch](https://github.com/unjs/ohmyfetch)**
20+
- **✅ Write in Typescript and Builded with [ESBuild](https://github.com/evanw/esbuild)**
2221
- **✅ Browser STDLib**
2322
- **✅ Custom Fonts && Purge Unused Fonts**
2423
- **✅ Plugins Ready!**
2524

26-
## TODO for v1
27-
28-
- [x] Bold, italic and underline text content;
29-
- [x] line break and page break content;
30-
- [ ] Table, list and checkbox content;
31-
- [x] [Nuxt 3 plugin](https://github.com/betterwrite/nuxt-pdfeasy);
32-
- [ ] Vue 3 plugin;
33-
- [ ] 90% coverage;
34-
- [ ] `Client-Side` and `Server-Side` with same features.
35-
3625
## Installation
3726

3827
```shell
@@ -140,7 +129,7 @@ pdfeasy.run({
140129
```ts
141130
pdfeasy.run({
142131
type: 'server',
143-
serverPath: path.resolve(process.cwd() + '/examples'),
132+
serverPath: '/examples',
144133
}).then(() => {}).catch((err) => {
145134
console.error(err)
146135
})
@@ -154,7 +143,7 @@ It is possible to define the color scheme used automatically:
154143
// converts all hex color to cmyk
155144
pdfeasy.run({ colorSchema: 'CMYK' })
156145

157-
// converts all hex color to rgb
146+
// preserve hex colors (it's default)
158147
pdfeasy.run({ colorSchema: 'RBG' })
159148
```
160149

@@ -177,11 +166,11 @@ pdfeasy.addFonts([
177166
178167
## Resources
179168

180-
See [source demo](./demo) for more explanations
169+
See [source demo](./packages/pdfeasy/demo) for more explanations
181170

182-
See [examples](./examples/) for .pdf results.
171+
See [examples](./packages/pdfeasy/examples/) for .pdf results.
183172

184-
See [scripts](./scripts/generate/) for server-side runner.
173+
See [scripts](./packages/pdfeasy/scripts/generate/) for server-side runner.
185174

186175
## Bundles
187176

demo/src/main.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import pdfeasy from 'pdfeasy'
1+
import pdfeasy, { Utils } from 'pdfeasy'
22
import './style.css'
33

44
const app = document.querySelector<HTMLDivElement>('#app')!
@@ -24,10 +24,15 @@ pdfeasy.add([
2424
{ raw: 'using...', text: {} },
2525
{ pageBreak: {} },
2626
{ raw: 'pdfeasy!', text: {} },
27+
...Utils.content(),
28+
...Utils.content(),
29+
...Utils.content(),
2730
{ raw: 'a checkbox...', checkbox: {} },
2831
{ raw: 'a first in list...', list: { style: 'counter' } },
2932
{ raw: 'a second in list...', list: { style: 'counter' } },
3033
{ raw: 'a third in list...', list: { style: 'counter' } },
34+
...Utils.content(),
35+
...Utils.content(),
3136
{ raw: 'a list with circle...', list: { style: 'circle' } },
3237
])
3338

packages/pdfeasy/src/utils/populate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ export const loremIpsum = () => {
3131
export const content = (): Content[] => {
3232
return [
3333
{ raw: loremIpsum().title() },
34-
{ raw: loremIpsum().paragraph(), text: { fontSize: 18 } },
34+
{ raw: loremIpsum().paragraph(), text: {} },
3535
{
3636
stack: [
37-
{ raw: loremIpsum().paragraph(), text: { lineHeight: 10 } },
38-
{ raw: loremIpsum().paragraph(), text: { lineHeight: 2 } },
37+
{ raw: loremIpsum().paragraph(), text: {} },
38+
{ raw: loremIpsum().paragraph(), text: {} },
3939
],
4040
},
4141
{ raw: loremIpsum().paragraph(), text: {} },

0 commit comments

Comments
 (0)