dom-to-image icon indicating copy to clipboard operation
dom-to-image copied to clipboard

Rendering images in node does not work?

Open Aaarrrgggh opened this issue 4 years ago • 1 comments

Hello all,

I'm using this library to generate images from node, with 1200x600 dimensions. This node contains several small images, at least 4 other small images.

None of those small images appear in the generated image.

Here is my code:

            domtoimage.toPng(document.getElementById('main'), { quality: 0.95, width:1200, height:600 })
    .then(function (dataUrl) {
        var link = document.createElement('a');
        /*link.download = '{{file}}';
        link.href = dataUrl;
        link.click();*/
        var img = new Image();
        img.src = dataUrl;
        document.body.appendChild(img);
    });

On Firefox, I have a problem for fetching resource (Javascript error). It does not work. On Chrome, It's working, except there is no image.

In a local environment, this works perfectly.

Someone has an idea?

Thanks all,

Alexander

Aaarrrgggh avatar Aug 28 '19 15:08 Aaarrrgggh

I am also facing the same issue. @Aaarrrgggh did u fix this?

KavinduAkash avatar Jun 02 '23 04:06 KavinduAkash