I am using html-pdf package in node.js to create a PDF file from a Html string, when i do it localhost it works fine, but when i deploy to iis server it raises the following error:
SetProcessDpiAwareness failed: "COM error 0x80070005 (Unknown error 0x0ffffffff80070005).
I'm using the following code :
var pdf = require('html-pdf');
//...
var html = '<html><head></head><body>Hello World!</body></html>';
var options = { format: 'Letter' };
pdf.create(html, options).toFile(fileNamePath, function (err) {
if(err) {
console.log(err);
}
});
Problem solved:
I was using V2.0.1 of html-pdf and downgrade to v1.5.0 and it works fine. I think the problem is in phantomjs that html-pdf uses, and in this case i am using V1.9.19.
User contributions licensed under CC BY-SA 3.0