Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jshtml-to-pdf) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Handlebars Puppeteer PDF Generator
Generate PDF documents using html template and javascript.
Installation
npm install jshtml-to-pdf
yarn install jshtml-to-pdfUsage 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));