I need to take a screenshot of the whole screen or just a div
. I used ngx-capture
and html2canvas
libraries but none of them works correctly and the resulting image is not exactly what we see on screen; is just like an empty div
with a border (my container div
or just a few items inside). Because it does not render the dynamic DOM and data inside the specified div
.
My questions are:
Is there any way to raise screenshot events (I mean click on the PrtSc key) programmatically in JS or Angular? I mean I want just the work the PrtSc key does (capture screen and copy to clipboard).
Why does
html2canvas
(and so doesngx-capture
) give an empty container or just an incomplete view of my container? Is there any way to fix it, or it does not work in Angular because DOM is rendered dynamically?