/ejs-to-pdf

Convert EJS file to PDF file

Primary LanguageJavaScriptMIT LicenseMIT

EJS to PDF (deprecated)

Total alerts Language grade: JavaScript

Install :

  • 1 - Download this repo
  • 2 - Extract the index.js & package.json & package-lock.json
  • 3 - Do an npm i in terminal

How to use :

const { ejsToPdf } = require('path_to_index.js');
let data           = require('path_to_data.json');

ejsToPdf("path_of_ejs_file.ejs" , data , "path_for_the_output_file.pdf");

Tips: You can use other databases like MySQL or MongoDB as long as data is passed and not undefined

Packages used :

  • EJS - Embedded Javascript template x view engine
  • HTML-PDF - Convert HTML to PDF
  • FS (alias FileSystem by default on NodeJS)