@pdfme/generator 1.0.3 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,24 @@
1
1
  # PDFME
2
+ <p>
3
+ <a href="https://github.com/pdfme/pdfme/blob/master/LICENSE.md">
4
+ <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="pdfme is released under the MIT license." />
5
+ </a>
6
+ <a href="https://github.com/pdfme/pdfme/actions/workflows/nodejs.yml">
7
+ <img src="https://github.com/pdfme/pdfme/workflows/Unit%20Testing/badge.svg" alt="Unit Testing status" />
8
+ </a>
9
+ <a href="https://www.npmjs.com/package/@pdfme/generator">
10
+ <img src="https://img.shields.io/npm/v/@pdfme/generator.svg" alt="Current npm package version." />
11
+ </a>
12
+ <a href="https://npmcharts.com/compare/@pdfme/generator?minimal=true">
13
+ <img src="https://img.shields.io/npm/dm/@pdfme/generator.svg" alt="Downloads per month on npm." />
14
+ </a>
15
+ <a href="https://pdfme.com/help#contribution">
16
+ <img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs welcome!" />
17
+ </a>
18
+ <a href="https://twitter.com/intent/tweet?text=Awesome+pdf+library%21&url=https://pdfme.com">
19
+ <img src="https://img.shields.io/twitter/url/http/shields.io.svg?style=social" alt="Tweet" />
20
+ </a>
21
+ </p>
2
22
 
3
23
  TypeScript base PDF generator and React base UI.
4
24
  Open source, developed by the community, and completely free to use under the MIT license!
@@ -33,7 +53,7 @@ As an example, the author's service [https://labelmake.jp/](https://labelmake.jp
33
53
 
34
54
  ## Installation
35
55
 
36
- The operating requirements should be the node environment `>=14`.
56
+ The operating requirements should be the node environment `>=14`. *Please see the note at the end of this section for usage on Node.js <16.*
37
57
  There are two packages in pdfme, generator and UI.
38
58
 
39
59
  The package for generating PDF can be installed with the following command.
@@ -75,6 +95,13 @@ import { Template, Designer, Form, Viewer } from '@pdfme/ui';
75
95
  **All objects use `Template`, which will be briefly explained in the next section.
76
96
  **
77
97
 
98
+ This package transiently relies on the function `atob()` being present in the globl namespace. This function is an old WebAPI which Node.js [added for legacy reasons in v16.0 to the global namespace](https://nodejs.org/dist/latest-v16.x/docs/api/globals.html#atobdata). If you are still using Node.js v14 or v15 you need to ensure that there's a function "atob()" in your global object which you can do by adding this snippet somewhere before executing any code from '@pdfme/generator':
99
+ ```js
100
+ if (!global.atob) {
101
+ global.atob = (data) => Buffer.from(data, "base64");
102
+ }
103
+ ```
104
+
78
105
  ## Template
79
106
 
80
107
  The core of pdfme library are Templates.
@@ -101,7 +128,7 @@ A blank A4 PDF can be imported with `BLANK_PDF`. You can use it to check how it
101
128
  Let's take a look at some specific data.
102
129
  (If you are using TypeScript, you can import the Template type.)
103
130
 
104
- ### Sample Template
131
+ ### Minimal Template
105
132
 
106
133
  ```ts
107
134
  import { Template, BLANK_PDF } from '@pdfme/generator';
@@ -273,6 +300,7 @@ const viewer = new Viewer({ domContainer, template, inputs });
273
300
  - [PDF.js](https://mozilla.github.io/pdf.js/): Used in PDF viewing.
274
301
  - [React](https://reactjs.org/): Used in building the UI.
275
302
  - [react-moveable](https://daybrush.com/moveable/), [react-selecto](https://github.com/daybrush/selecto), [@scena/react-guides](https://daybrush.com/guides/): Used in Designer UI.
303
+ - [dnd-kit](https://github.com/clauderic/dnd-kit): Used in Designer UI.
276
304
  - [bwip-js](https://github.com/metafloor/bwip-js): Used in barcode generation.
277
305
  - [zod](https://github.com/colinhacks/zod): Used in Validation.
278
306
 
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @name @pdfme/generator
3
- * @version 1.0.3 | Thu Mar 10 2022
3
+ * @version 1.0.6 | Sat May 07 2022
4
4
  * @author hand-dot
5
5
  * @license MIT
6
6
  */
package/package.json CHANGED
@@ -1,8 +1,16 @@
1
1
  {
2
2
  "name": "@pdfme/generator",
3
- "version": "1.0.3",
3
+ "version": "1.0.6",
4
4
  "author": "hand-dot",
5
5
  "license": "MIT",
6
+ "keywords": [
7
+ "pdf",
8
+ "pdf-generation",
9
+ "pdf-designer",
10
+ "pdf-viewer",
11
+ "typescript",
12
+ "react"
13
+ ],
6
14
  "description": "TypeScript base PDF generator and React base UI. Open source, developed by the community, and completely free to use under the MIT license!",
7
15
  "homepage": "https://pdfme.com",
8
16
  "repository": {