Search code examples
phpinstallationdompdf

DOMPDF Installation


I'd like to use DOMPDF, so I downloaded v0.6.2 on my PHP server (it meets the requests: php version, GD, mbstring...)

I'm a newbie so I didn't use git or composer, just downloaded the package and put it in a folder (named DOMPDF) of my webserver (Apache 2.4 / Windows 2008 server).

I wrote this very simple example and put it directly in the DOMPDF folder:

<?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");
?>

Nothing works!!! It seems I haven't the correct require directive. Is it an installation problem? What files must I include? Thanks.


Solution

  • I had to manually install php-font-lib...

    Everything OK now.