text: import domtoimage from "dom-to-image";
  
  function downloadImage() {
  
      var node = document.getElementById('img');
      
      const scale = 3;   
  
      const style = {
          transform: 'scale('+scale+')',
          transformOrigin: 'top left',
          width: node.offsetWidth + "px",
          height: node.offsetHeight + "px"
      }
  
      const param = {
          height: node.offsetHeight * scale,
          width: node.offsetWidth * scale,
          quality: 1,
          style
      }
    
      domtoimage.toPng(node, param).then(function (dataUrl) {
              var img = new Image();
              img.src = dataUrl;
              downloadURI(dataUrl, "records.png")
          })
          .catch(function (error) {
              console.error('oops, something went wrong', error);
          });
  }
    
  function downloadURI(uri, name) {
      var link = document.createElement("a");
      link.download = name;
      link.href = uri;
      document.body.appendChild(link);
      link.click();
      document.body.removeChild(link);
      link.remove();
  }
  
  export default downloadImage;