0

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:

  1. 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).

  2. Why does html2canvas (and so does ngx-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?

Jago
  • 2,751
  • 4
  • 27
  • 41
Jalaleddin Hosseini
  • 2,142
  • 2
  • 25
  • 28

1 Answers1

0

Not sure if your can access the OS and trigger the PrtSc event from a browser, however I found a post that may be relevant? Using HTML5/Canvas/JavaScript to take in-browser screenshots

Hawk_on
  • 1
  • 1
  • 2