2016-02-26 56 views
1

我想使用DOMPDF,所以我下载v0.6.2我的PHP的服务器上(它满足的要求:PHP版本,GD,MBSTRING ...)DOMPDF安装

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

我写了这个非常简单的例子,并把它直接在文件夹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指令。这是一个安装问题吗?我必须包含哪些文件? 谢谢。

回答

0

我不得不手动安装php-font-lib ...

现在一切正常。

+0

从github下载时,请确保您下载的是打包版本,而不是原始源(不包括外部依赖项)。您可以从[发布页面](https://github.com/dompdf/dompdf/releases)获取打包版本。 – BrianS