-
Notifications
You must be signed in to change notification settings - Fork 144
Open
Description
I have:
this.wkhtmltopdf = async function () {
try {
console.log("createpdf")
var response = await $http({
url: '/wkhtmltopdf',
method: "POST",
responseType: 'blob',
data:{"b":"XXX"}
});
if (response.status != 200) {
this.message = this.gs("downloadFailed", "There was an error downloading the file");
return;
}
var blob = new Blob([response.data], { type: 'application/*' });
saveAs(blob, 'test.pdf');
} catch (err) {
$window.alert('There was an error in getting the file');
}
};
It is installed in package:
"wkhtmltopdf": "^0.3.4"
I have installed the tool from their official website as recommended by SO users in other threads, and in the official npm:
https://www.npmjs.com/package/wkhtmltopdf
From https://wkhtmltopdf.org/downloads.html#stable
I have this PATH in my environment variables, both User and System vars
And STILL getting this error on my machine, but on cloud it's working:
C:\Users\Samer\Desktop\ALL fineon projects\azure-fineon-webapp-fo\node_modules\wkhtmltopdf\index.js:161
throw new Error(err); // critical error
^
Error: Error: spawn wkhtmltopdf ENOENT
at ChildProcess.<anonymous> (C:\Users\xxx\Desktop\ALL xxprojects\azure-xx-webapp-fo\node_modules\wkhtmltopdf\index.js:161:11)
at Object.onceWrapper (events.js:286:20)
at ChildProcess.emit (events.js:198:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
So what else to do?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
