var fs = require('fs');
var pdf = require('html-pdf');
//var pdf = require('html-pdf');
var html = fs.readFileSync(resp, 'utf8');
var options = { format: 'Letter' };
pdf.create(html, options).toFile('./businesscard.pdf', function (err, res) {
if (err) return console.log(err);
console.log(res); // { filename: '/app/businesscard.pdf' }
});
this having below error: Failed to compile. ./src/app/components/sscclabel-container/screen2.js Module not found: Can't resolve 'html-pdf' in 'C:\REACT\MDCV3\src\app\components\sscclabel-container'
Terminate batch job (Y/N)? y Note below command works and odf file is generated. PS C:\REACT\MDCV3> html-pdf ./businesscard.html businesscard2.pdf PS C:\REACT\MDCV3>