Aller au contenu

Do you support PDFlib with PHP?

Ce contenu n’est pas encore disponible dans votre langue.

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.

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
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');

Cette page vous a-t-elle aidé ?