node-phantom-simple icon indicating copy to clipboard operation
node-phantom-simple copied to clipboard

Pass "options" object to render method

Open danielguajardok opened this issue 8 years ago • 1 comments

Any chance we can pass an "options" object to the render method, so we can modify the quality of the exported image?

danielguajardok avatar Feb 26 '16 23:02 danielguajardok

The page.render function accepts three arguments as can be seen on PhantomJSs API: webpage.render. The first being the filename, the second being the format and the third being the quality.

If you want to set the quality of the exported image, you could do something like this:

webpage.render('filename.png', 'png', 100, function(err) {
  // Done rendering
});

If you really need the options to be an object, you could look into higher level libraries based on this wrapper.

Reewr avatar Feb 27 '16 16:02 Reewr