I have a react component that is outputting a raw html string that I want to use to generate an image. This is different from most proposed solutions that I've seen that require either rendering this html to canvas and then capturing the canvas. I can turn that raw html into a document with jsPDF which I was going to use in memory to extract the image. I know this is a less than optimal solution. Basically I want to go from raw html to png ideally.
exportHtml = () => {
this.editor.exportHtml((data) => {
const { design, myHtml } = data;
var doc = new jsPDF("landscape", "pt", "A4");
//Rather than outputting a pdf here this is where I'd expect to have an image in memory to save or pass
doc.html(myHtml, {
callback: () => {
//This is where we would send the png'd pdf off to our storage
doc.save("test.pdf");
},
});
});
};