1.1.9 • Published 7 months ago

smart-pdf-generator v1.1.9

Weekly downloads
-
License
ISC
Repository
-
Last release
7 months ago

@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 default
  • printBackground Print images that are on the template background or not, true by default
1.1.9

7 months ago

1.1.8

7 months ago

1.1.7

7 months ago

1.1.6

7 months ago

1.1.5

7 months ago

1.1.4

7 months ago

1.1.1

2 years ago

1.1.0

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago