L
L
lexstile2021-08-08 01:39:03
JavaScript
lexstile, 2021-08-08 01:39:03

How to save svg as image on click?

There is xml code svg.
How to download this code as an image (png)?

There is a code that generates a QR code :

const qrSvg = vkQr.createQR(payUrl, {
    qrSize: 256,
    isShowLogo: true,
    isShowBackground: true,
    backgroundColor: '#fff',
    logoData: user.photo,
    // foregroundColor: '#000',
  });

// В qrSvg находит xml код svg.

You need to display a link, in the href of which insert a link to the image to download.
<a href="image.png" download>Скачать</a>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question