You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
I ran into the very same issue. Looking at the older discussion in here, a very hacky workaround (I guess okay for very short term if you're doing development on windows machine) is to do what's described here (#29).
In a nutshell, you can change the node_modules/wkhtmltopdf/index.js the variable wkhtmltopdf.command to be the full path to the executable binary instead of just attempting to spawn wkhtmltopdf. This could be fixed in a much smarter way on the library side, but if this is blocking your work temporarily that's at least a workaround.
I have:
It is installed in package:
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:
So what else to do?
The text was updated successfully, but these errors were encountered: