tsayen / dom-to-image

Generates an image from a DOM node using HTML5 canvas
Other
10.21k stars 1.68k forks source link

Take screenshot of element bigger than viewport? #334

Open alvarotrigo opened 4 years ago

alvarotrigo commented 4 years ago

I'm using a viewport of 500px width. However, I want the image to take a width of 2000px .

Right now I can't manage to do so. The image itself is 200px width if I pass the width: 2000 option, but anything from 500px onwards is transparent and doesn't really contain anything.

It there anyway we can fix this so we can take pictures at a fixed width no matter what width we are currently using to load our site?

MugheesAhmadTariq commented 3 years ago

Its also generates dark space for the elements that are partially outside the container. Can anyone help me over here ?