Closed cheapsteak closed 3 years ago
This is technically possible by introducing a button to link to the image link generated for og:image right?
@kenrick95 that wouldn't quite export the current view, would prefer if it exports exactly what the user is seeing :)
This looks promising - https://www.npmjs.com/package/html-to-image , specifically the toBlob
maybe make a new button (to the right of "download csv") and attach this to the onclick
htmlToImage.toBlob(document.getElementById('my-node'))
.then(function (blob) {
fileSaver.saveAs(blob, 'my-node.png');
});
(would also need https://www.npmjs.com/package/file-saver , which is fine (just 1.2kb gzipped))
Cool! Let me try this out 😁
Okay I tried that html-to-image
package, and it seems like it doesn't generate a very good image.
May be related to this bug report
[..] it doesn't seem to be processing CSS classes for SVG elements [..]
p.s. I also tried html2canvas and it has similar issues with rendering svg
Seems like a simpler solution that would get an accurate svg rendering is the og:image (which I believe is generated using headless browser 😅 )
@kenrick95 thanks so much for investigating!
Currently have to go into minimal mode and screen cap
Should have a single button that exports the current view