0

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?

Elydasian
  • 2,016
  • 5
  • 23
  • 41
zeta_reticuli
  • 115
  • 2
  • 5
  • 15

1 Answers1

3

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

Community
  • 1
  • 1
Osama Sayed
  • 1,993
  • 15
  • 15
  • thank you, it works... after i did that, displayed another similar error but with other folder. i fixed it as the same way require_once __DIR__ . '/lib/html5lib/Parser.php'; require_once __DIR__ . '/lib/php-font-lib/src/FontLib/Autoloader.php'; require_once __DIR__ . '/lib/php-svg-lib/src/autoload.php'; now i could convert a simple text to PDF – zeta_reticuli Jun 19 '16 at 21:43