EDIT: webshot throws an error in DigitalOcean: webshot-error [Error: PhantomJS exited with return value 2]
I am using this code to generate pdf:
` let fileUri = process.env.PWD + '/storage/orders-pdf/' + fileName;
// Commence Webshot
webshot(html_string, fileUri, options, function(error) {
fs.readFile(fileUri, function (err, data) {
if (err) {
return console.log(err);
}
fs.unlinkSync(fileUri);
fut.return(data);
});
});
let pdfData = fut.wait();`
The code works perfectly on localhost, but fails on the server and throws this error:
{ [Error: ENOENT, open '/opt/holi/storage/orders-pdf/Attributes.pdf'] errno: 34, code: 'ENOENT', path: '/opt/holi/storage/orders-pdf/Attributes.pdf' }
EDIT: webshot throws an error in DigitalOcean:
webshot-error [Error: PhantomJS exited with return value 2]
I am using this code to generate pdf:
` let fileUri = process.env.PWD + '/storage/orders-pdf/' + fileName;
The code works perfectly on localhost, but fails on the server and throws this error:
{ [Error: ENOENT, open '/opt/holi/storage/orders-pdf/Attributes.pdf'] errno: 34, code: 'ENOENT', path: '/opt/holi/storage/orders-pdf/Attributes.pdf' }