Forum Moderators: coopster

Message Too Old, No Replies

How to output a file as an image file?

         

cameraguy

10:06 pm on Jul 27, 2006 (gmt 0)

10+ Year Member



Hello,

I wrote a web counter in php that displays text and images. What I am now trying to do is to convert the output of this php script in an image. Why? Because certain blogs like MSN Spaces do not accept that you embed scripts.

I believe I should look into the imagecreatefrom functions for a solution, but I find very little examples of how to use it, expecially imagecreatefromgd2 and the likes. Ideally I would need a function that allows me to input a URL (like my php script) and that ouputs an image.

Perhpas someone can help me with this?

lobo235

4:57 pm on Jul 30, 2006 (gmt 0)

10+ Year Member



If you are wanting it to render the html formatting on your page then you will have to do some pretty complicated stuff like passing the html text through an html-rendering engine and then capturing an image from that. If your page just outputs some plain text that you want converted to an image that is easier. You can grab the text output and use the gd2 library to create an image.