PHP kullanarak Geçerli sayfanın ekran görüntüsü

7 Cevap php

Çift:

website screenshots using php

PHP kullanarak geçerli sayfanın ekran görüntüsünü almak mümkün mü?

7 Cevap

Eğer windows üzerinde iseniz. Orada imagegrabscreen()

PHP tarayıcı yok, sayfayı oluşturmak değildir.

Here is a list of tools ki sen sonra konum ne yapalım.

Hayır *

  • PHP tarayıcı istemci üzerinde web sunucusu üzerinde değil çalışan ve uzaktan işletim sistemi tarayıcısı veya diğer kısımlarını kontrol edemez.

Yüklemek webkit2png on your server ve ardından yürütebilir webkit2png http://yourpage.example.com from your PHP script. That will give you a screenshot the way Webkit renders the page. For installing on Linux, see this.

Teorik olarak, hayır, ne isterseniz yapacağım PHP zaten bir şey yok, bir PHP uzantısı olarak HTML düzen motoru yazmak ve bu kullanabilirsiniz ... Ama olabilir.

Sen a command-line utility like this kullanmak ve PHP diyebiliriz.

Screengrab!: İşte düzgün bir Firefox eklentisi bulunuyor

If you are using Windows platform, you can install ACA WebThumb ActiveX: http://www.acasystems.com/en/web-thumb-activex

Bir basit demo:


<?php
  // PHP html to image.
  // This script shows how to convert the google.com homepage to a PNG image file.
  $WebThumb_Maker = new COM('ACAWebThumb.ThumbMaker')
    or die("Start ACAWebThumb.ThumbMakerfailed");

  $WebThumb_Maker->SetURL("http://www.google.com"); 
  if ( 0 == $WebThumb_Maker->StartSnap() )
  {
    // Tanke snapshot successful, call SetImageFile() to save the image as a PNG file.
    echo "Take snapshot successful." ;
    $WebThumb_Maker->SaveImage("google.png");
  }
?>