Hi there everyone! I’m trying to export my 3d scene into a pdf but whole Canvas area is coming blank in the pdf. So I was thinking is there anyway I could convert my 3d scene into 2d and then export it into pdf??
I’m using jspdf and R3F
i read that it makes the app a tiny bit slower, is that true @mjurczyk ?
snapshotting can also be done without preserveDrawingBuffer, just call gl.render(scene, camera) before you save.
anyway the code to create a png:
const link = document.createElement('a')
link.setAttribute('download', 'canvas.png')
link.setAttribute('href', document.querySelector('canvas').toDataURL('image/png').replace('image/png', 'image/octet-stream'))
link.click()