html-to-pdf-studio
Converting HTML template to PDF files
System Requirements
- Node.js (version >= 10)
Installing
yarn add html-to-pdf-studio
Usage
Compiling a handlebars HTML template
const fs = ;const path = ;const compileHTML createPDF = ; const cssPath = path;const css = fs; const htmlPath = path;const html = fs; let data = ;const dataBinding = Object; const compiledHTML = ;
Create PDF file from final HTML compiled with handlebars previously demonstrated
const path = ;const createPDF = ; const fileName = "invoide.pdf";const outputPath = path; if !fs fs; const pdfOptions = format: "A4" headerTemplate: "<p></p>" footerTemplate: "<p></p>" displayHeaderFooter: false margin: top: "40px" bottom: "100px" printBackground: true path: path; async { await ;};
Inspiration
License
Copylefted (c) 2020 Henrique Carvalho da Cruz Licensed under the MIT license.