50
Views
5
Comments
[Html 2 Image] Does not support IOS.
html-2-image
Reactive icon
Forge asset by Romel Guerra

This component is working amazing on android but is at all not supporting IOS. It does not throw any error too. We tried with 3 4 iphones and none of them worked.
I saw one more post of this same issue on this component.
Anyone able to figure this out?
 

Thanks,
Anagha 

2023-09-26 11-47-11
Sergio Bessa

Any luck making it work on iOS?

2020-02-13 05-29-21
Anagha Chikate

Hello Sergio,
No the component did not worked for us and we got it done with javascript.

Thanks,
Anagha 


2023-09-26 11-47-11
Sergio Bessa

Did you use the same script from http://html2canvas.hertzen.com/  on your javascript solution?

Thanks,

Sérgio


Anagha Chikate wrote:

Hello Sergio,
No the component did not worked for us and we got it done with javascript.

Thanks,
Anagha 


 

 

2020-01-08 17-34-22
Diogo Mota

Hi Anagha,

Can you share your solution?

Thanks,

Diogo.

2020-02-13 05-29-21
Anagha Chikate

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



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.