Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript - How to convert text into image

I need to convert the text into the image using the Javascript. I tried convert-text-to-image-using-javascript. But here in my script I have the bold & italics also in text. With that it is not converting the bold directly, it simply shows the normal text.

For Ex: if I give like this "StackOverFlow" It gives "StackOverFlow" not the bold ones

Updated

I am able to enter the Bold, Italic characters in the text filed, but get the value of the text filed in my JS side I am getting the normal text. There also I need to get the formatted text.

like image 673
Mallikarjuna Avatar asked May 11 '26 11:05

Mallikarjuna


1 Answers

html input or textarea cant manage different styles within their value, you can use a wysiwyg like this then extract the html and parse it.

based on my example link you can do this:

jQuery('.wysiwyg-editor').contents()

this will return an array with every html elements, then use what you ve tryed before.

Hope this help

like image 120
Vanojx1 Avatar answered May 14 '26 00:05

Vanojx1