DOMPDF安装

DOMPDF Installation

我想使用 DOMPDF,所以我在 PHP 服务器上下载了 v0.6.2(它满足要求:php 版本、GD、mbstring...)

我是新手,所以我没有使用 git 或 composer,只是下载了软件包并将其放在我的网络服务器 (Apache 2.4 / Windows 的文件夹(名为 DOMPDF)中2008 服务器)。

我写了这个很简单的例子,直接放在DOMPDF文件夹下:

<?php
// c:\apache24\htdocs\dompdf\sample.php

print ("I see this in HTML output");

require_once("dompdf_config.inc.php");

print("Can't see this... and nothing that follows of course!");

$html = '<html><body><p>Hello world!</p></body></html>';

$dompdf = new DOMPDF(); 
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("sample.pdf");
?>

没有任何效果!!!看来我没有正确的 require 指令。是安装问题吗?我必须包含哪些文件? 谢谢

我必须手动安装 php-font-lib...

现在一切正常。