HOW DO I CONVERT DIV CONTENT INTO AN IMAGE

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
adsegzy
Forum Contributor
Posts: 184
Joined: Tue Jul 28, 2009 9:26 am

HOW DO I CONVERT DIV CONTENT INTO AN IMAGE

Post by adsegzy »

Hello Friends,

Am working on a greeting card project (like http://www.funkypigeon.com) where after customizing a card, you can submit it to DB and a thumbnail of what you created will be generated.

At submitting the card, I generate d customization in txt like below.But how do i generate a thumnail from this text div. HELP PLS

Code: Select all

<!--TEXT DIVS-->
<table class="draggable cardinputs ui-draggable" id="f1" contenttype="text" style="z-index: 4; position: absolute; top: 30px; left: 100px; padding: 3px; height: 20px; width: 150px; text-align: center; vertical-align: middle; border: 2px solid rgb(221, 221, 221);"><tbody><tr><td style="font-family: "PassionOne-Bold"; font-size: 20px;">Happy Birthday Daddy</td></tr></tbody></table>


<table class="draggable cardinputs ui-draggable" id="f1a" contenttype="text" style="z-index: 3; position: absolute; top: 290px; left: 100px; padding: 3px; height: 20px; width: 150px; text-align: center; vertical-align: middle; border: 2px solid rgb(221, 221, 221); font-weight: bold;"><tbody><tr><td style="font-family: "Bangers"; font-size: 16px;">From: Mummy</td></tr></tbody></table>



<!--BG DIV OVER-->
<div class="draggable cardinputs ui-draggable" id="f2" contenttype="image" style="z-index: 2; text-align: center; position: absolute; top: 95px; left: 72px; padding: 0px; height: 160px; width: 200px; border: 2px solid rgb(204, 0, 0);"></div>

<!--FRONT CARD BG HOLDER-->
<div id="frontimgbg" style="z-index: 1; background-image: url("http://localhost/cards/admin/upload/frontbgs/frozen.jpg");"></div>

<!--BG DIV HOLDER-->
<div id="customimg" contenttype="image" style="z-index: 0; text-align: center; position: absolute; top: 85px; padding: 0px; height: 180px; width: 300px; background: url("http://localhost/cards/admin/upload/photos/Picture0002.jpg") no-repeat scroll center top / auto 100% transparent; left: 22px;"></div>
Thanks
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: HOW DO I CONVERT DIV CONTENT INTO AN IMAGE

Post by Celauran »

What have you tried? PHP has built in image manipulation functions (though a library like Image Magick or GD must be installed). You might also want to look at something like Imagine
Post Reply