tags:

views:

66

answers:

4

Hi,

is that possible to show whole php page as an image file like png or jpg ?

for example,

<img src="details.php?id=44">

just like a screenshot of the page.

Thx

A: 

Not in the way you're thinking. You can use the PHP ImageMagick library or the PHP GD Library to generate an image dynamically and output it, but in order to get screenshots of a page you'll really need an outside service.

Xorlev
how can i do this with Imagick ?
Ahmet vardar
Taking a screenshot of the page will be impossible with ImageMagick. If you just want to display stuff with ImageMagick (not a rendered HTML/CSS page), take a look at http://us.php.net/manual/en/class.imagick.php
Xorlev
A: 

it depends on what you want to show. if its html/js/css, it varies across browsers.

If its unicode text to be displayed as images, you can use GD library for the purpose

Sairam Kunala
A: 

I think you are talking about taking screenshots of a url or webpage. You can you freely available like: http://www.shrinktheweb.com/ http://picoshot.com/ There are many such freely available services. If you want to host such service on your own server. You will need to create a software which can open your browser and take screenshot of the url. Ther are some softwares available as well. I hope it helps.

askkirati
A: 
  <?
  // details.php file
  // {
  // do stuff to create your image and store in $my_image
  // }
  header("Content-type: image/jpg");
  echo $my_image;
  ?>

1) output the mime type in the header.

2) echo your binary data

easy!

Talvi Watia
uhh.. he wants a screenshot of the HTML output of the PHP script.
nickf
so what would a screenshot of a page that makes a screenshot look like? recursion??
Talvi Watia