poleposters Posted April 20, 2008 Share Posted April 20, 2008 This might sound like an odd question. I want my users to be able to create a restaurant menu to include on their profile pages. I want to make things easy for them and create the menu online, since I doubt many of them would be able to create an image themselves even using paint(sounds silly, but most people have no idea!) So I am investigating whether it is possible to "print" a HTML page(complete with syle) to a JPEG using PHP. The reason I need a jpg is becaue I am using a flash/php pageflip book. If anyone can tell me if this is possible, and if so , point me in the right direction, that would be great! And if anyone has any alternative methods to achieve this, I would appreciate any suggestions. Cheers! Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted April 20, 2008 Share Posted April 20, 2008 Well, you can create images on the fly with the GD library: www.php.net/gd To make them look like an HTML page would either take a lot of effort to parse the HTML page and determine what it's supposed to like, or it might be possible to use this function: imagegrabwindow() The above function is only supported with a PHP version of 5.2.2 or higher, and a window machine. It should be possible to save the HTML the user generates, then use that function to take a screenshot of it. Finally, you could use the gd library functions to create an image. Quote Link to comment Share on other sites More sharing options...
dptr1988 Posted April 20, 2008 Share Posted April 20, 2008 This is pretty hard to do. Basicly you need a web browser or other HTML rendering program installed on the server and have the PHP script run that rendering program, and return the result. As for doing it all in PHP, it's pretty much impossible, unless you were to write a complete HTML renderer in PHP. ( Way too hard!!! ) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.