Dom-to-image: Div scroll issue

Created on 1 Feb 2018  路  8Comments  路  Source: tsayen/dom-to-image

Use case:

If we have much data in a div and i am trying to get small complete image of that content, that time it is giving me scroll in image and only visible part of that div is reflecting in image

[jsfiddle]([https://jsfiddle.net/singhalpiyush1993/2m8dcr63/26/])
https://jsfiddle.net/singhalpiyush1993/2m8dcr63/26/

Expected behavior

i should get complete content in image

Actual behavior (stack traces, console logs etc)

getting only visible part of that saction

Most helpful comment

In the last version of the library, it is no need to add
width: auto; height: auto

Passing the scroll height and width options should be enough:
domtoimage.toPng(node, { width: node.scrollWidth, height: node.scrollHeight })

See a working example here: https://jsfiddle.net/najorcruzcruz/kL9us4x1/6/

All 8 comments

+1 i Have this problem, and waiting a correct ansver for this.

Hi Guys,
Is there any idea i can try to resolve this issue?

You fix This Problem with div inside div method,

Up level div overflow scroll and have width and heighth, inside div width and height auto

when you try render, select inside div, then it get real width and heigth of element without scroll capture..

sample.