Php 将基本html文件转换为图像

Php 将基本html文件转换为图像,php,javascript,html,Php,Javascript,Html,有没有php或javascript方法可以将包含文本的简单html文件转换为JPEG图像并自动保存。我希望能够将其作为公司动态免责声明的“嵌入式内容”引入Outlook 2007 任何帮助都将不胜感激 更新 我发现以下脚本只生成一个字符串图像: <?php $text = "This is a example"; header("Content-Type: image/png"); $im = @imagecreate(700, 300) or die("Cannot Initialize

有没有php或javascript方法可以将包含文本的简单html文件转换为JPEG图像并自动保存。我希望能够将其作为公司动态免责声明的“嵌入式内容”引入Outlook 2007

任何帮助都将不胜感激

更新

我发现以下脚本只生成一个字符串图像:

<?php
$text = "This is a example";
header("Content-Type: image/png");
$im = @imagecreate(700, 300)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 255, 255, 255);
$text_color = imagecolorallocate($im, 0, 0, 0);
imagestring($im, 12, 5, 5,  $text, $text_color);
imagepng($im);
imagedestroy($im);
?>

有没有办法让

标记在php字符串中工作?

使用
imageTTFtext()
函数并连接

标记

<?php
header(“Content-type: image/gif”);

 $string = 'This is another text i want to include';
 $im = imagecreate( 400, 200 );
 $red = imagecolorallocate($image, 255,0,0);
 $blue = imagecolorallocate($image, 0,0,255 );
 $font = “/usr/local/jdk121_pre-v1/jre/lib/fonts/LucidaSansRegular.ttf”;

 imageTTFtext( $im, 50, 0, 20, 100, $blue, $font, “This is some text!” );

 imagegif($im);
 ?>

希望你现在就明白了…

你是说自动版的
打印屏幕
?在windows机器上打印scr。听起来你不需要做多次。如果你在一个稳定的系统下,比如说Linux,我想你可以通过命令行实用程序
scrot
,轻松地实现自动化。基本上,它可以将普通html文本转换为图像文件。php脚本听起来仍然不需要自动化,也不需要成为纯文本上的图形。
imageTTFtext( $im, 50, 0, 20, 100, $blue, $font, “This is some text!<br/>”.$string."some other text" );