How to generate a JPG image from html


#1

Hi,

I would like to render an image from a html information, in order to share it later via SocialSharing.

How can I create a JPG image? is there any cordova plugin or javascript ionic compatible library?

Thanks in advance.


#2

Hi

Did you check screenshot plugin?

Just a hunch

Rgds

Tom


#3

thanks @Tommertom, screenshot is not an option, we would like to render an exact layout and not depending on user device screen.

any idea?


#4

Html to jpg javascript


#5

Hi. Were you able to do it? I need to implement a similar feature


#6

Hi @rivendil, I didn’t do it yet, I found this ,maybe it is usefull for you:

Let us know if you use it in Ionic 3.

Thanks!


#7

Ok so it works pretty well with Ionic 3. On some pages I couldn’t make it work though. Sometimes the base64 encoded image generated by the library doesn´t render properly img tags. I suppose you have to try it by yourself and see if It works for your particular usecase.

Oh and I also had an issue with some icons and the detail-push on ion-item


#8

thanks for your feedback, we will try to implement this library in the future. Best regards.


#9

Thank you. But issue is that it will not work on Safari in PWA (Progressive web app).