Best way to convert text/string to image in Node.JS

11.1k views Asked by At

I want to convert my text string into an image with basic font. I would like to do this on Node server. Are there any libraries that you might have worked with? Any help is greatly appreciated.

1

There are 1 answers

0
ptr On BEST ANSWER

Try node-canvas. If you have experience working with html5's canvas element on the client side, you can do it with this on the server side as well - and there is the .toDataURL method for exporting the drawing into a data-url blob (which contains basically a base64-ed png image).