Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.
/ ejs-to-pdf Public archive

Convert EJS file to PDF file

License

Notifications You must be signed in to change notification settings

Ex0D/ejs-to-pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)