2019.6.5 • Published 5 years ago
@secretboy/pdf v2019.6.5
v2019.06.05
Generate pdf using handlebars template engine.
Usage
Install the package:
npm install --save @secretboy/pdf
Then use like this:
const sb_pdf = require('@secretboy/pdf')
let pdfRes = await sb_pdf.generate(html, options, pdfOptions, path)
Parameters:
html
- HTML template in string format.
options
- Variables to replace in the template. See handlebars templates for more info.
pdfOptions
format
- String. (defaultA4
)orientation
- String. (defaultportrait
)border
- String. default(10mm
)
path
- String path for output file.