Closed GameDungeon closed 1 year ago
That doesn't seem that simple.... Did you check other projects? None is doing it?
And yes, please provide examples.
I have some time today, and I was going to do a PR. There is one issue with this idea. You need an actual reference to the canvas object instead of just a string as you can have with everything else. Figuring out that, I could make a PR.
I ended up doing this on my end. I realize this is a bit out of scope for this lib.
Treating canvas elements as images would allow dynamic js generated images as a way to make up for how more complex HTML isn't possible in PDFMake.
I would provide an example for your renderer, but it does not support JS, which is needed to draw onto the canvas.
It is rather simple to extract the image form a canvas as can be seen here.