node-server-screenshot icon indicating copy to clipboard operation
node-server-screenshot copied to clipboard

screenshot resolution issue

Open kwiser opened this issue 6 years ago • 1 comments

long page resolution not good. Some css not working in capture.

website: https://artoonsolutions.com/

screenshot taken by this plugin:

artoonsolutions

kwiser avatar Jan 06 '20 11:01 kwiser

Hi!

Thanks for the report.

I believe that the CSS didn't have time or has failed to properly load and i could not replicate the issue. As for the resolution, you can set the scale factor (which equates to the devicePixelRatio in the browser's rendering)

In the code below, i give the CSS more time to load (5s) and set the scale to 2x:

app.fromURL(
  "https://artoonsolutions.com/",
  "artoonsolutions.png",
  {
    scale: 2,
    show: false,
    width: 1280,
    height: 16000,
    waitMilliseconds: 5000
  },
  function (err) {
    if (err) {
      return console.error(err);
    }

    console.log('done')
  }
);
Result

The image below is at 1.8x as the 2x variant was larger than 10MB and github would not allow me to upload it. artoonsolutions

legraphista avatar Jan 17 '20 10:01 legraphista