This thing is really irritating. Actually I know how to convert HTML to image using html2canvas library. But I just want to know how most of the people who have Facebook fun apps like this and this, create images.
I can get all the required user information using FB API, then how should I create an JPG/PNG image like them? What I have tried is html2canvas
but I don't think all other fun apps use this thing. Because when viewed their source code, I couldn't see the HTML element containing all the content of the image that needs to be generated using html2canvas
. Even the canvas element is NOT present. Only the image is displayed.
So, there can be 3 possibilities:
They do whole processing in a separate HTML/PHP page using Ajax (Which is another question, I searched a lot but couldn't find single answer related to that: See Query below).
They do hide the HTML and its corresponding CANVAS element using z-index or something and show only generated image.
They don't use
html2canvas
. They use something else.
Query related to 1: Is it possible for Ajax call to execute an HTML page including JS, CSS (say URL: 'convertAndReturnImage.php'
and render the result and return the generated image/URL using html2canvas
in success
function?