pofider / phantom-html-to-pdf

Highly scalable html to pdf conversion using phantom workers
MIT License
159 stars 33 forks source link

Converted pdf texts are not showing clearly #51

Closed SantoshSKhavekar closed 7 years ago

SantoshSKhavekar commented 7 years ago

Hi ,

I am using this module to convert html string to PDF file in node.js like this,

var htmlstr="<h1>Test</h1><p>Hello world</p>";
var conversion = require("phantom-html-to-pdf")();
conversion({ html: htmlstr}, function(err, pdf) {
  console.log(pdf.logs);
  console.log(pdf.numberOfPages);  
  pdf.stream.pipe(fs.createWriteStream(__dirname+'/destination.pdf'));   
});

after that I viewed pdf file ,in that the text is not showing .

pofider commented 7 years ago

You may be missing some packages required by phantomjs. Please check troubleshooting installation section

https://github.com/pofider/phantom-html-to-pdf#installation-troubleshooting

SantoshSKhavekar commented 7 years ago

Yes I missed out.Now It is working like charm after doing these two installation "urw-fonts" and "fontconfig". Thank you guys.....