This tutorial about generating the image from the HTML. You can just create the HTML and put this code after your code and it will generate the image from your HTML. below is the easy step to generate the image from custom HTML.
Step 1)
Create one php file like index.php as below
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Html To Image</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"> </script>
<script src="https://files.codepedia.info/files/uploads/iScripts/html2canvas.js"> </script>
<div class="bingo-box bingo-green generatedata" id="generatedata1" data-id="1">
<div class="number-row number-row1">
<div class="number number1">1</div>
<div class="number number2">2</div>
<div class="number number4">4</div>
<div class="number number5">5</div>
<div class="number number5">9</div>
</div>
</div>
<script>
$(document).ready(function() {
var getCanvas;
$( ".generatedata" ).each(function( index ) {
var dataid = $( this ).attr("id");
var catid = $( this ).data("id");
var datafid = parseInt(index) + parseInt(1);
var element = $("#"+dataid);
html2canvas(element, {
onrendered: function(canvas) {
getCanvas = canvas;
var imgageData = getCanvas.toDataURL("image/png");
var newData = imgageData.replace(/^data:image\/png/, "data:application/octet-stream");
$.ajax({
type: "POST",
url: "upload.php",
data: {
imgBase64: newData
}
}).done(function(o) {
console.log('saved');
});
}
});
});
});
</script>
Step 2)
Create another page like upload.php
<?php
$catid = $_POST['catid'];
$folderPath = "upload_img/";
$image_parts = explode(";base64,", $_POST['imgBase64']);
$image_type_aux = explode("image/", $image_parts[0]);
$image_type = $image_type_aux[1];
$image_base64 = base64_decode($image_parts[1]);
$filename = uniqid() . '.png';
$file = $folderPath . $filename;
file_put_contents($file, $image_base64);
?>
Step 3)
Now Just run index.php file to your browser this will generate the image in folder.
I am incessantly thought about this, thanks for posting.
Thank you for your feedback auto locksmith
I reckon something truly special in this website.
Thank You For Your Feedback chwilowka online
Some really great info, Gladiola I detected this. I’m not spaming. I’m just saying your website is AWSOME! Thank you so much!
Thank You For Your Feedback renault kangoo key replacement
Really nice design and good subject material.
Thank You For Your Feedback mercedes c class key replacement
I could not refrain from commenting. Very well written! Anita Marten Britta
Thank You For Your Feedback turkce
This is really attention-grabbing, You are an excessively professional blogger. Kira Sheff Chancey
Thank You For Your Feedback escort bayan
I think everything posted was actually very reasonable. Juditha Phillip Mansur
Thank You For Your Feedback Cialis Super Pill
I like the valuable info you provide in your articles. I will bookmark your weblog and check again here frequently. I am quite sure I will learn lots of new stuff right here! Best of luck for the next! Ediva Si Belden
Thank you for your feedback Ediva Si Belden
Hi i am kavin, its my first occasion to commenting anyplace, when i read this paragraph i
thought i could also create comment due to this good
piece of writing.
Can I just say what a relief to discover a person that
genuinely knows what they are talking about
online. You actually understand how to bring a problem to light and make
it important. A lot more people must read this and understand this side of the story.
I can’t believe you aren’t more popular since you certainly have the gift.
I like the helpful information you supply for
your articles. I will bookmark your weblog and check again here regularly.
I am slightly certain I will be told lots of new stuff
right right here! Best of luck for the next!
What i don’t realize is in reality how you
are no longer really much more smartly-preferred
than you may be right now. You are so intelligent. You realize therefore considerably on the subject of this
topic, produced me in my view imagine it from numerous varied angles.
Its Your own stuffs excellent.
This is a topic that’s near to my heart… Take care!
Exactly where are your contact details though?
You wanted to see me, Sir?
I was two steps into his office, my suit jacket sliding down my arms as I walked to my location between the chairs in front of his desk.
“Something has come to my attention that might be interesting.”
It wasn’t normal for him to blurt out what was on his mind when I was summoned to his office. We had established something of a protocol of how this was to work.
It was akin to a tribal ritual of exchanging pleasant conversation prior to entering into serious exchange, a ritual intended to maintain civility and peace and calm prior to any interaction.
I had thought ours was the same, though it had never been expressed or defined. I undressed and he sat back in his chair to enjoy it prior to entering into any business.
Excellent write-up.
I absolutely appreciate this website.
Keep writing!
I think this is a real great blog article. Really Cool.
Really appreciate you sharing this article.Really looking forward to read more. Fantastic.
hi this is hi try content laa. I think that’s enough to try ulaaaaaaaaaaaaaaaa
Pretty great post. I just stumbled
upon your weblog and wished to say
that I’ve really enjoyed browsing your blog
posts. After all I’ll be subscribing to your feed and I hope
you write once more very soon!
terrific as well as fantastic blog. I really intend to thank
you, for providing us far better details.
I like what you guys are usually up too. This sort of clever work and exposure!
Keep up the very good works guys I’ve included you
guys to blogroll.
What’s up, after reading this awesome paragraph i
am as well glad to share my know-how here
with mates.
Hiya very nice site!! Guy .. Beautiful .. Amazing .. I will bookmark
your blog and take the feeds also? I am happy to find numerous useful information here within the publish, we need work out extra techniques in this regard, thanks for
sharing. . . . . .
If some one wishes to be updated with newest technologies then he must be go to see this web page and be up to date all the time.
លុយដុល្លារក្លែងក្លាយលក់នៅសៀមរាប
លុយដុល្លារក្លែងក្លាយលក់នៅសៀមរាប
I’m impressed, I have to admit. Rarely do I come across a
blog that’s both educative and entertaining, and let
me tell you, you’ve hit the nail on the head. The issue is
an issue that too few men and women are speaking intelligently about.
Now i’m very happy I stumbled across this in my search for something relating to this.
Thank you for another wonderful article. The place else could anyone get
that type of information in such a perfect method of
writing? I’ve a presentation subsequent week, and I’m on the search
for such information.
Wow, wonderful blog layout! How long have you been blogging for?
you make blogging look easy. The overall look of your website is excellent,
let alone the content!
Great post. I was checking continuously this blog and I am
impressed! Extremely useful information specifically the last part 🙂 I care for such information much.
I was seeking this particular information for a very long time.
Thank you and good luck.
This is a topic which is close to my heart… Many thanks!
Exactly where are your contact details though?
Thank You,
You can contact with us using following details.
Email: info.hashencrypted@gmail.com
Skype: info.hashencrypted
Whatsapp: +918460113068
Website Contact: http://hashencrypted.com/contact/
This is the perfect web site for anyone who would like to find out about this topic.
You realize so much its almost hard to argue with you (not that I really would want to…HaHa).
You certainly put a new spin on a topic that’s been written about for ages.
Wonderful stuff, just excellent!
Thanks to my father who informed me on the topic of this web site, this website is in fact remarkable.
I for all time emailed this blog post page to all my friends, as if
like to read it then my friends will too.
If some one desires to be updated with most up-to-date technologies afterward he must
be go to see this web page and be up to date all the time.
That is a really good tip especially to those fresh to the blogosphere.
Simple but very precise information… Appreciate your sharing this one.
A must read article!
Thanks , I’ve just been searching for info about this subject for a
long time and yours is the best I have discovered till now.
However, what about the bottom line? Are you positive in regards to the source?
Check out my site :: แทงหวยออนไลน์
Thanks
Hi yes it is positive for source
When someone writes an article he/she retains the image of a user in his/her mind that how a user can know it.
So that’s why this article is great. Thanks!
You actually make it seem so easy with your presentation but I find this topic to be actually something which I think I would never
understand. It seems too complicated and extremely broad for me.
I am looking forward for your next post, I will try to
get the hang of it!
I’m not certain the place you are getting your information, but
great topic. I must spend a while studying much more or figuring out more.
Thank you for excellent info I was looking for this information for my mission.
Right on my man!
I’m pretty pleased to discover this web site.
I want to to thank you for ones time just for this fantastic read!!
I definitely liked every bit of it and i also have you saved as a favorite to see
new information in your web site.
Thanks for any other excellent post. The place else may anybody get that type of info in such a perfect way of writing?
I have a presentation subsequent week, and I’m at
the look for such information.
Excellent post. I am experiencing a few of these issues as well..
Good day! Do you use Twitter? I’d like to follow you if that would be ok.
I’m definitely enjoying your blog and look forward to new updates.
Hurrah! In the end I got a web site from where I be capable of genuinely
obtain valuable facts regarding my study and
knowledge.