Socket
Socket
Sign inDemoInstall

pdfkit-table

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pdfkit-table - npm Package Compare versions

Comparing version 0.1.23 to 0.1.24

2

package.json
{
"name": "pdfkit-table",
"version": "0.1.23",
"version": "0.1.24",
"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",

@@ -16,3 +16,3 @@ # pdfkit-table

## Start
## Install

@@ -29,9 +29,20 @@ ```bash

const doc = new PDFDocument({ margin: 30, size: 'A4' });
// file name
doc.pipe(fs.createWriteStream("./file-table.pdf"));
// the magic:
// paramns
const table = {
headers: [],
datas: [/* complex data */],
rows: [/* or simple data */],
}
// options
const options = {}
// the magic
doc.table( table, options );
//...
// done!
doc.end();
```

@@ -145,3 +156,8 @@

## Table
- <code>Array.&lt;object&gt;</code>
- headers <code>Array.&lt;object&gt;</code> | <code>Array.[]</code>
- datas <code>Array.&lt;object&gt;</code>
- rows <code>Array.[]</code>
Example code:

@@ -180,13 +196,13 @@ ```js

### Options Table
### Options
| Properties | description |
-----------------------|-------------------|
| **width** | width of table |
| **x** | position x (left) |
| **y** | position y (top) |
| **columnSpacing** | 5 |
| **rowSpacing** | 3 |
| **prepareHeader** | Function |
| **prepareRow** | Function |
| Properties | Type | Default | Description |
-----------------------|-----------------------|--------------------|-------------------|
| **width** | <code>Number</code> | undefined | width of table |
| **x** | <code>Number</code> | undefined | dox.x | position x (left) |
| **y** | <code>Number</code> | undefined | dox.y | position y (top) |
| **columnSpacing** | <code>Number</code> | 5 | |
| **rowSpacing** | <code>Number</code> | 3 | |
| **prepareHeader** | <code>Function</code> | Function | |
| **prepareRow** | <code>Function</code> | Function | |

@@ -262,2 +278,4 @@

- renderer function. Like renderer: (value) => { return `$${value}`}
- load json file - require | string
- sample with database
- setFontFamily {String}

@@ -264,0 +282,0 @@ - setBoldFontFamily {String}

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc