pdfkit-table-ts
Advanced tools
Comparing version 0.0.3 to 0.0.4
{ | ||
"name": "pdfkit-table-ts", | ||
"version": "0.0.03", | ||
"version": "0.0.04", | ||
"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": "lib/index.js", |
# pdfkit-table-ts | ||
TypeScript - Helps to draw informations in simple tables using pdfkit. #server-side. Generate pdf tables with javascript (PDFKIT plugin) | ||
```js | ||
const fs = require("fs"); | ||
const { PDFDocument } = require("./../lib/index"); | ||
const doc = new PDFDocument({ | ||
margin: 30, | ||
}); | ||
;(async function(){ | ||
// to save on server | ||
doc.pipe(fs.createWriteStream("./example-1.pdf")); | ||
// ----------------------------------------------------------------------------------------------------- | ||
// Simple Table with Array | ||
// ----------------------------------------------------------------------------------------------------- | ||
const table = { | ||
headers: ["Country Country Country", "Conversion rate", "Trend"], | ||
rows: [ | ||
["Switzerland", "12%", "+1.12%"], | ||
["France", "67%", "-0.98%"], | ||
["England", "33%", "+4.44%"], | ||
["England of England of England", "33%", "+4.44%"], | ||
["Switzerland", "12%", "+1.12%"], | ||
["France", "67%", "-0.98%"], | ||
["England", "33%", "+4.44%"], | ||
["England of England of England", "33%", "+4.44%"], | ||
["Switzerland", "12%", "+1.12%"], | ||
["France", "67%", "-0.98%"], | ||
["England", "33%", "+4.44%"], | ||
["England of England of England", "33%", "+4.44%"], | ||
["Switzerland", "12%", "+1.12%"], | ||
["France", "67%", "-0.98%"], | ||
["England", "33%", "+4.44%"], | ||
["England of England of England", "33%", "+4.44%"], | ||
["Switzerland", "12%", "+1.12%"], | ||
["France", "67%", "-0.98%"], | ||
], | ||
}; | ||
const options = { | ||
width: 300, | ||
x: 150, | ||
y: 100, | ||
padding: { | ||
top: 1, bottom: 1, left: 5, right: 5, | ||
}, | ||
}; | ||
await doc.table(table, options); | ||
doc.end(); | ||
})(); | ||
``` |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
107703
58