Can I use PDFlib with PHP scripts?

We're occasionally asked if we can install the PDFlib software (also known as "php_pdf.dll") on our servers.

Unfortunately, PDFlib isn't a free program — it's commercial software with an expensive license fee per server. Since there are free alternatives available, we don't provide PDFlib on our servers (nor do other Web hosting companies that we know of).

Using FPDF instead

The alternative that most people use is FPDF. We have FPDF installed on our servers at:

/usr/share/fpdf/fpdf.php

The following FPDF example works correctly on our servers:

<?php
require_once('/usr/share/php/fpdf/fpdf.php');

$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();
?>