smart-pdf-generator
v1.1.10
Published
Generate beautiful pdf with Handlebars on NodeJS
Downloads
140
Readme
@bsight/smart-pdf-generator
Smart PDF Generator
Installation
$ npm i smart-pdf-generator
Features
- Export beautiful Handlebars templates to PDF in one command
- Save PDF to file
Basic usage
const smartPDF = require("smart-pdf-generator");
let people = ["Arthur", "Julie", "Martin"];
let hbsTemplatePath = "./templates/people-list.handlebars";
// => Generate PDF
const pdf = smartPDF.generatePDF(hbsTemplatePath, { people });
// => Save to file
smartPDF.savePDFToFile(pdf, "./exports/myAwesomePDF.pdf");
It is also possible to use options
as a third argument of generatePDF
function where you pass
everything in a single object. The list of options is listed below.
Options
format
Format of the exported PDF,A4
by defaultprintBackground
Print images that are on the template background or not,true
by default