# Do you support PDFlib with PHP?

> No. PDFlib isn't available on Ruachost hosting because it is a commercial product. Use a free PHP PDF library such as Dompdf or TCPDF instead.

Source: https://helpcenter.ruachost.com/faq/guides/do-you-support-pdflib-with-php/

**No.** PDFlib is not available on Ruachost hosting.

PDFlib is a commercial, third-party product that needs its own licence and a special PHP extension, so it isn't installed on our servers.

## Free alternatives

You can create PDF files from PHP with free libraries that don't need a server extension. Install them in your project with Composer:

| Library | Good for | Install command |
| --- | --- | --- |
| **Dompdf** | Turning HTML and CSS into a PDF | `composer require dompdf/dompdf` |
| **TCPDF** | Detailed layouts, barcodes, many languages | `composer require tecnickcom/tcpdf` |
| **FPDF** | Simple, lightweight PDFs | `composer require setasign/fpdf` |

A short Dompdf example:

```php
<?php
require 'vendor/autoload.php';
use Dompdf\Dompdf;

$dompdf = new Dompdf();
$dompdf->loadHtml('<h1>Invoice</h1><p>Thank you for your order.</p>');
$dompdf->render();
$dompdf->stream('invoice.pdf');
```

## Related articles

- [Installing Composer](https://helpcenter.ruachost.com/developers/php/installing-composer/)
- [Do you support HTMLDoc with PHP?](https://helpcenter.ruachost.com/faq/guides/do-you-support-htmldoc-with-php/)
