Open juliusknorr opened 5 months ago
@hweihwang Could you check what options we would have to generate a preview image of a whiteboard? We would need to implement a PHP provider for the preview files but could issue a request to the whiteboard server to handle the whiteboard to image conversion in node.js. Maybe you can evaluate how this could be implemented and give an effort estimation
Thanks @juliusknorr
I mainly think of 2 ways:
1. Client-Side Rendering: The user's browser would generate the preview each time they make a change. We can use Excalidraw's exportToBlob
API to create an image and save it directly within the file. PHP can then easily access this image for previews.
2. Server-Side Rendering: Headless browser (Puppeteer) would generate the preview, either on PHP or Node side but preferred on the Node.js for simple and native. The preview can be saved directly to the file upon changes (within Node.js) or generated on demand.
It would be great to generate some previews, certainly nothing for the first iteration