Hi,
I am using this module to transform html to pdf on the fly in my website. What i observed is whenever there are Chinese characters in my html, it transforms to boxes in pdf. Is this you are aware of?
Here is the snippet
var options = {format: 'Letter'};
options.border = {
"top": "30px",
"right": "30px",
"bottom": "30px",
"left": "30px"
};
pdf.create(html, options).toStream(function (err, stream) {
//TODO:Handle err
res.setHeader('Content-Type', 'application/pdf');
res.setHeader('Content-disposition', 'attachment; filename="'+ 'Document - '+result.docId + '.pdf"');
stream.pipe(res);
});
This either has something to do with some missing fonts or with the unicode
problem that phantomjs has.
This problem occurs when the html doesn't contain a charset and falls back
to iso8859-1. This is fixed in phantomjs 2 and thus will be fixed in here
soon.
I knew of the problem where emojis aren't rendered. Thanks for reporting.
Maybe I should write some FAQs 馃榾
I installed the fonts and it worked :smile: Thanks!
hehe :smile: Good to know.
@sripaulgit Which fonts on Ubuntu?
@sripaulgit Which fonts on CentOS?
Most helpful comment
@sripaulgit Which fonts on Ubuntu?