[英]Html-Pdf not creating file on IIS Server with Node.js
我在 node.js 中使用 html-pdf 包從 Html 字符串創建一個 PDF 文件,當我在 localhost 執行它時它工作正常,但是當我部署到 iis 服務器時它會引發以下錯誤:
SetProcessDpiAwareness 失敗:“COM 錯誤 0x80070005(未知錯誤 0x0ffffffff80070005)。
我正在使用以下代碼:
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);
}
});
問題解決:
我正在使用 html-pdf 的 V2.0.1 並降級到 v1.5.0,它工作正常。 我認為問題出在 html-pdf 使用的 phantomjs 中,在這種情況下,我使用的是 V1.9.19。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.