Is it correct to import Cpdf.php?

213 views
Skip to first unread message

Lucio Santos

unread,
Oct 15, 2019, 8:45:53 AM10/15/19
to dompdf

I'm using DOMPDF as "Download and Install", but if it only using autoloader
require_once 'dompdf/src/Autoloader.php', I run into the error:
include (Cpdf.php): failed to open stream: No such file or directory.

To solve, I simply add the line require_once 'dompdf/lib/Cpdf.php', leaving my code like this:

require_once 'dompdf/lib/Cpdf.php';
require_once 'dompdf/src/Autoloader.php';
Dompdf\Autoloader::register();
use Dompdf \ Dompdf;

I would like to know if it is correct, or if this would be a not very cool way to use it, and if it is necessary to add other libs, like Font-Lib, for example. Thanks!

BrianS

unread,
Jan 20, 2020, 4:47:47 PM1/20/20
to dompdf
This is not the correct way to instantiate Dompdf. Have you read through the Installation and Quick Start in the README?
Reply all
Reply to author
Forward
0 new messages