jshtml-to-pdf

1.0.16 • Public • Published

Handlebars Puppeteer PDF Generator

Generate PDF documents using html template and javascript.

Installation

npm install jshtml-to-pdf
yarn install jshtml-to-pdf

Usage example

const { readFileSync, writeFileSync } = require("fs");
const { create } = require("jshtml-to-pdf");

const html = readFileSync(__dirname + "/example.html", "utf8");

const document = {
  html: html,
  data: {
    customer: {customerCode: '12345', name: 'Francesco', surname: 'Clementi', fiscalCode: '123456678'},
  },
}

create(document).then(doc => writeFileSync(__dirname + '/test.pdf', doc));

Package Sidebar

Install

npm i jshtml-to-pdf

Weekly Downloads

9

Version

1.0.16

License

MIT

Unpacked Size

14.3 kB

Total Files

9

Last publish

Collaborators

  • francesco.clementi