pdf-table

1.0.2 • Public • Published

pdf-table

pdf-table helps you to generate PDF documents with table from any NodeJS server. We use PDF Kit under the hood.

Installation

yarn add pdf-table or npm install --save pdf-table

Usage

const pdfTable = require('pdf-table');
module.exports = (req, res) => {
    ...
    pdfTable({
    heading: 'Hello World!',
    columnHeaders: ['Sl. No', 'Name'],
    rows: [[1, 'Jane Doe'], [2, 'John Doe']],
    pdfName: 'Names',
    footer: 'This is a sample doc',
    res
  });
}

You need to pass a res parameter to the config. This is your HTTP response object. pdf-table will attach the generated PDF file to this res object.

Readme

Keywords

Package Sidebar

Install

npm i pdf-table

Weekly Downloads

14

Version

1.0.2

License

MIT

Unpacked Size

4.89 kB

Total Files

3

Last publish

Collaborators

  • amalamarypaul