Last active
May 6, 2022 23:43
-
-
Save reacto11mecha/a6263f714f6a9dceeedaea28956f2fad to your computer and use it in GitHub Desktop.
Canva incorrect image render after downloaded, but display correct when edit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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