1

I have a web application, written in node.js with express framework, and Twitter Boostrap 3 in front end, and i'm using this module node-webshot in order to save a state of a page in png format, when a users logout from my site, later show to the user a little thumbnail of, his last state of the page.

This module, works really nice, but i'm experimenting some issues, examples:

On localhost environment (OSX 10.9): enter image description here

When i put my application on my Digital Ocean VPS (GNU/Linux -> CentOS 6.5). enter image description here

As you can see, are two differents issues, in the first one fail to get the glyphicons and in the second one fail with .... character encoding maybe?.

Here is the portion of my code that save the image, and works perfect, except by this two issues.

var options = {
  quality : 50,
};

webshot(refererURL, './public/assets/img/lastScreen.png',
  options, function(err) {

  if(err) console.log('Error: some in screenshoot' , err);
  res.render('select_sys');
});

In the module docs, says this works with phantomJS, some ideas?

Thanks in advance.

Gonzalo Bahamondez
  • 1,371
  • 1
  • 16
  • 37
  • 1
    possible duplicate of [phantomjs screenshot font missing, boxes rendered instead](http://stackoverflow.com/questions/15029002/phantomjs-screenshot-font-missing-boxes-rendered-instead) – Artjom B. Jul 26 '14 at 09:18
  • 1
    And the other one: [Phantomjs not render hebrew fonts](http://stackoverflow.com/q/23780925/1816580) – Artjom B. Jul 26 '14 at 09:19
  • Thanks a lot, it's true, the first one is duplicated, and the solution in the answers works really nice, but what about the OSX issue? – Gonzalo Bahamondez Jul 26 '14 at 15:13
  • 1
    Ok, i change the module for this one https://github.com/sindresorhus/pageres , is like the same, but all just works in OSX – Gonzalo Bahamondez Jul 26 '14 at 16:58

1 Answers1

2

I had the same issue with node-webshot. Rather than giving up on node-webshot entirely, I updated the module's phantomjs to phantomjs 2.0. Then I installed the fonts, and whallah. PhantomJS 2.0 just needs to be moved into webshot/node_modules/phantomjs/lib, and /bin directories to be safe. Hope this works for you!