我正在尝试使用html-pdf节点模块从html生成pdf。我目前正在使用cloud9 IDE运行它。
我的代码是:
var fs = require("fs");
var pdf = require('html-pdf');
var html = fs.readFileSync('./test.html', {encoding: 'utf8'});
var options = { format: 'Letter' };
app.post('/pdf',function(req, res) {
pdf.create(html, options).toFile('./businesscard.pdf', function(err, res) {
if (err) return console.log(err);
console.log(res); // { filename: '/app/businesscard.pdf' }
});
});
我收到以下错误:
[Error: Fontconfig warning: ignoring C.UTF-8: not a valid language tag]
有谁知道我该如何解决这个问题?
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句