html2canvas is a JavaScript library that allows web developers to render a screenshot of a webpage or a specific element on the page as a canvas object. This allows developers to capture screenshots of webpages and export them into multiple formats, including JPEG, PNG, and SVG. The library can be used to create screenshots of webpages, including the layout and content of the page, as well as interactive elements such as buttons, text boxes, and forms. html2canvas is also capable of capturing images from HTML elements, including images and videos. The library also supports various events such as onload, onerror, and onrendered. html2canvas is a powerful tool for web developers to capture and export webpages and elements without having to manually take screenshots.
You can process to SVG so that HTML has inline styles and text remains selectable, but it uses foreignObject which is not compatible with IE (IE is dead for me).