zeta_reticuli
zeta_reticuli

Reputation: 157

HOW TO: convert HTML to PDF with PHP/DOMpdf?

I need your help to fix this:

My current code is this:

<?php 
      require_once '../dompdf/autoload.inc.php';
      use Dompdf\Dompdf;

      $dompdf = new Dompdf();
      $html = 'Insert full HTML content';
      $dompdf->loadHtml($html);
      $dompdf->setPaper('A4', 'landscape');
      $dompdf->render();
      $dompdf->stream("codexworld",array("Attachment"=>0));
?>

This is the error a get:

Why if I have exactly the same code like the basic example, am I getting this error? What am I missing? I don't find in my folder the Autoloader.php, where do I have to get that file?

Upvotes: 0

Views: 3554

Answers (1)

Osama Sayed
Osama Sayed

Reputation: 2023

Well apparently it's an issue after domPdf has moved to Github. It seems that php-font-lib library doesn't exist. So one solution is to manually download it:

or you can check this answer here

Upvotes: 3

Related Questions