Skip to content

Instantly share code, notes, and snippets.

@reacto11mecha
Last active May 6, 2022 23:43
Show Gist options
  • Select an option

  • Save reacto11mecha/a6263f714f6a9dceeedaea28956f2fad to your computer and use it in GitHub Desktop.

Select an option

Save reacto11mecha/a6263f714f6a9dceeedaea28956f2fad to your computer and use it in GitHub Desktop.
Canva incorrect image render after downloaded, but display correct when edit
// Run it step by step
// You need to search where is the upper div, for example
const node = document.querySelector('.uPeMFQ');
// wait until fetched correctly, check the network tab in your developer tools
fetch('https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js').then(res => res.text()).then(text => eval(text))
// It will print the image, just copy it
html2canvas(node).then(canvas => console.log(canvas.toDataURL('image/png'), '_blank'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment