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.52 to 0.1.53

25

index.js

@@ -255,3 +255,3 @@ // jshint esversion: 6

const calcColumnsSizes = () => {
const calcColumnSizes = () => {

@@ -262,16 +262,19 @@ let h = []; // header width

// 1o - Max size table
// (table width) 1o - Max size table
w = this.page.width - this.page.margins.right - ( options.x || this.page.margins.left );
// 2o - Size defined
options.width && ( w = String(options.width).replace(/[^0-9]/g,'') );
// (table width) 2o - Size defined
options.width && ( w = String(options.width).replace(/[^0-9]/g,'') >> 0 );
// 1o
// (table width) if table is percent of page
// ...
// (size columns) 1o
table.headers.forEach( el => {
el.width && h.push(el.width); // - columnSpacing
});
// 2o
// (size columns) 2o
if(h.length === 0) {
h = options.columnsSize;
}
// 3o
// (size columns) 3o
if(h.length === 0) {

@@ -288,10 +291,10 @@ columnWidth = ( w / table.headers.length ); // - columnSpacing // define column width

// Set columnSizes
// !Set columnSizes
h.length && (columnSizes = h);
p.length && (columnPositions = p);
// 3o - Sum last position + lest header width
// (table width) 3o - Sum last position + lest header width
w = p[p.length-1] + h[h.length-1];
// Set tableWidth
// !Set tableWidth
w && ( tableWidth = w );

@@ -307,3 +310,3 @@

calcColumnsSizes();
calcColumnSizes();

@@ -310,0 +313,0 @@ // Header

{
"name": "pdfkit-table",
"version": "0.1.52",
"version": "0.1.53",
"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",

@@ -349,21 +349,10 @@ # pdfkit-table

- [Suggestions / Issues / Fixes](https://github.com/natancabral/pdfkit-table/issues)
- cellPadding {Array} [5,2,5,2];
- striped {Boolean} (corsimcornao)
- colspan - the colspan attribute defines the number of columns a table cell should span.
- renderer function on cell. Like renderer: (value) => { return `$${value}`}
- sample with database
- alignment
- setFontFamily {String}
- setBoldFontFamily {String}
- verticalLines {Boolean}
- verticalLinesWidth {Number}
- verticalLinesColor {String}
- horizontalLines {Boolean}
- horizontalLinesWidth {Number}
- horizontalLinesColor {String}
- tableLine {Boolean}
- tableLineWidth {Number}
- tableLineColor {String}
- margin: marginBottom before, marginTop after
- add line bottom or line top

@@ -374,3 +363,3 @@ ## Changelogs

+ Max size age
+ Max size page

@@ -377,0 +366,0 @@ ### 0.1.48

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