khtml2png2

[不指定 2008/02/26 10:42 | by ipaddr ]

khtml2png2
==========

khtml2png is a command line program to create screenshots of webpages. It uses
libkhtml (the library that is used in the KDE webbrowser Konqueror) and
"convert" from the ImageMagick graphic conversion toolkit.


Requirements
============
For running and compiling you need some libraries and tools. You can find the
Debian package names in braces.

 * g++
 * KDE 3.x
 * kdelibs for KDE 3.x (kdelibs4-dev)
 * zlib (zlib1g-dev)
 * cmake


Introducing informations
========================
Extract the archive with: tar xfvz <file name>

Afterwards check the requirements and install missing development packages.


Compiling and installation
==========================
This is done with the usual three steps

 1. ./configure
 2. make
 3. make install


Static file
===========
If you have chosen the precompiled statically linked file you don't need to
install KDE or KDE librariers. Just extract the file with

 bunzip2 <file name>

and place it in a directory used for binaries (e.g. /usr/bin or /usr/local/bin).
If you like you can rename the executable.
!!! Make sure the khtml2png2 file is executable (e.g. chmod +x <file name>). !!!


Running
=======

khtml2png2 [options] url outfile

Options:
  -w, --width <width>       Width of canvas on which to render html [800]
  -h, --height <height>     Height of canvas on which to render html [1000]
  -t, --time <time>         Maximum time in seconds to spend loading page [30]
  --auto <id>               Use this option if you to autodetect the bottom/right border []
  --disable-js              Enable/Disable javascript (enabled by default)
  --disable-java            Enable/Disable java (enabled by default)
  --disable-plugins         Enable/Disable KHTML plugins (like Flash player, enabled by default)
  --disable-redirect        Enable/Disable auto-redirect by header <meta > (enabled by default)
  --disable-popupkiller     Enable/Disable popup auto-kill (enabled by default)

Example:

 khtml2png2 --width 800 --height 1000 http://www.kde.org/ kde-org.png

or

 khtml2png --auto ID_border http://www.kde.org/ kde-org.png

====安装====
1.将PHP5解压到C:\PHP目录
2.修改Apache的配置文件,加入:
LoadModule php5_module "C:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
修改:
DirectoryIndex index.php index.htm index.html default.htm

====配置====
1.将C:\PHP\php.ini-dist改为php.ini并移动到C:\Windows\目录
2.修改php.ini里面的extension_dir = "C:\php\ext\"
3.打开需要使用的extension,比如php_mbstring.dll, php_mysql.dll
Ipaddr特别提醒:某些extension需要使用其它的DLL,你可能需要将C:\php目录下的相关Dll复制到C:\Windows目录(比如,php_mysql.dll需要将C:\php下的libmysql.dll复制到C:\Windows)
4.重新启动Apache,并检查Apache的error.log是否有PHP的错误信息

====测试====
在Apache的DocumentRoot目录下,创建一个php.php,使用phpinfo()函数,检查PHP是否安装正确,以及所需的extension是否加载.

分页: 2/2 第一页 上页 1 2 最后页 [ 显示模式: 摘要 | 列表 ]