brenden / node-webshot

Easy website screenshots in Node.js
2.12k stars 286 forks source link

siteType: 'html' does not resolve any dependancy #140

Closed agustik closed 8 years ago

agustik commented 8 years ago

I'm trying to render html from variable to PNG image. The HTML is created with some dynamic and I use Bootstrap css.

If I use the siteType: 'html' or 'file' it does not resolve the dependancy. But if i create a http server and serve the file over HTTP it works.

webshot(html, 'image.png', { siteType : 'html' }, function(err) {
  console.log('Created image.png', err)
});
agustik commented 8 years ago

Solved

npm install phantomjs2

Add phantomPath: require('phantomjs2').path to options

var options = { phantomPath: require('phantomjs2').path }

mutil commented 7 years ago

Solution posted by @agustik is not working for me, produces same output.