pdfkit-table
Advanced tools
Comparing version 0.1.76 to 0.1.77
{ | ||
"name": "pdfkit-table", | ||
"version": "0.1.76", | ||
"version": "0.1.77", | ||
"description": "PdfKit Table. Helps to draw informations in simple tables using pdfkit. #server-side. Generate pdf tables with javascript (PDFKIT plugin) ", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -26,3 +26,3 @@ <p align="center"> | ||
## Install | ||
## Install [<img src="https://github.com/natancabral/pdfkit-table/blob/main/example/npm-tile.png">](https://www.npmjs.com/package/pdfkit-table) | ||
@@ -36,9 +36,11 @@ ```bash | ||
```js | ||
// requires | ||
const fs = require("fs"); | ||
const PDFDocument = require("pdfkit-table"); | ||
// start pdf document | ||
// create document | ||
let doc = new PDFDocument({ margin: 30, size: 'A4' }); | ||
// file name | ||
doc.pipe(fs.createWriteStream("./document.pdf")); | ||
// table | ||
@@ -48,11 +50,8 @@ const table = { | ||
headers: [], | ||
datas: [/* complex data */], | ||
rows: [/* or simple data */], | ||
datas: [ /* complex data */ ], | ||
rows: [ /* or simple data */ ], | ||
} | ||
// options | ||
const options = {}; | ||
// callback | ||
const callback = () => {}; | ||
// the magic | ||
doc.table( table, options, callback ); // is a Promise to async/await function | ||
doc.table( table, { /* options */ }, () => { /* callback */ } ); | ||
// doc.table() is a Promise to async/await function | ||
@@ -59,0 +58,0 @@ // if your run express.js server |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44028
601