(PECL ps >= 1.1.0)
ps_lineto — 绘制一条直线
示例 #1 绘制一个矩形
<?php
$ps = ps_new();
if (!ps_open_file($ps, "rectangle.ps")) {
print "无法打开 PostScript 文件\n";
exit;
}
ps_set_info($ps, "Creator", "rectangle.php");
ps_set_info($ps, "Author", "Uwe Steinmann");
ps_set_info($ps, "Title", "Lineto 示例");
ps_begin_page($ps, 596, 842);
ps_moveto($ps, 100, 100);
ps_lineto($ps, 100, 200);
ps_lineto($ps, 200, 200);
ps_lineto($ps, 200, 100);
ps_lineto($ps, 100, 100);
ps_stroke($ps);
ps_end_page($ps);
ps_delete($ps);
?>