First write html as follows
in JS you need to import html2canvas.js. you can download this js from this location.
using printDiv function we can create screenshot and display on the page.
Remember we can display image on Canvas as well, but in my case I was getting blurry images on canvas, so instead on canvas i displayed it on img tag.