Hey,
Sorry for replying so late.
You can try the below javascript for mobile.
var tCtx;
var img;
function textToImage (){
img = document.createElement('image');
img.id = "my-image";
document.getElementsByClassName('output')[0].appendChild(img);
var canvas = document.createElement('canvas');
tCtx = canvas.getContext("2d");
tCtx.textAlign = "center";
canvas.height = 60;
canvas.width=300;
document.getElementsByClassName('output')[0].appendChild(canvas);
tCtx.fillText(document.getElementsByClassName('my-input')[0].value, 10, 40);
img.src = tCtx.canvas.toDataURL();
}
This script basically creates a canvas and converts your text from my-input into an image using toDateURL function.
Now call this function as javascript funtion is any action, so that you will get your image in the attribute that is img.src.
Get the output of this javascript function by assigning it to an output variable like
Output =JavaScript.outputImage where outputImage being the output parameter of the script.
Just make sure you name the css elements properly.
Hope this helps.
Anagha