https://html2canvas.hertzen.com this is a project that maybe interrests you :) if you have a frontent based on react or another js frontend rendering engine :) i still recommend @janVladimirMostert approachs
I am aware of html2canvas but it's slow and doesn't feel great. (It's my fallback if I can't find a better method lol). I'm toying with the idea of virtual DOM's etc though
well i would go for the dom+shadowdom since the virtualdom is a meta abstraction used to generate the dom hence it does not represent the dom :) i have the same issue but in the end i thought of using the jquery text representation of the dom and add id as hidden form i generate "on snapshot" :D