Hi all,
I am building a plugin and having trouble rendering an HTML.
Currently, I am trying to take a string html, render it to an image and take a screenshot of that image to display on Figma. I’ve tried it with a screenshot, base64, uint8array, but have found no success so far.
My current process looks like this:
- Input: HTML string
- Server-side Processing:
- The HTML string is sent to server endpoint
- The HTML is rendered using puppeteer
- The screenshot is converted to either base64 string, png, or uint8array (Tried all three)
- The the image data is received in Figma
- A new image is created in Figma using figma.createImageAsync()
I am getting errors on step 2, and the error seems to be that puppeteer is not working properly in Figma plugin’s sandboxed environment.
Has anyone had any luck generating screenshots from raw HTML string?
Thank you!