2
I’m getting the following error:
Fatal error: Class 'wkhtmltopdf Pdf' not found in /Applications/XAMPP/xamppfiles/htdocs/common/class/Prepagoconsulta.php on line 480
Excerpt from the code:
use wkhtmltopdf\Pdf;
class PrePagoConsulta extends Query
{
public function gerarPDF($html, $nomeArquivo){
$pdf = new Pdf($html); // * Linha 480
if (!$pdf->saveAs($_SERVER['DOCUMENT_ROOT'].'/upload/consultas-pre/'.$nomeArquivo.'.pdf')) {
echo $pdf->getError();
}
}
}
And the folder structure is as follows:
In the autoload_psr4.php, I’m setting it this way:
return array(
'wkhtmltopdf\\' => array($vendorDir.'/wkhtmltopdf/src')
);
How can I correct the error? Where am I missing? hehe
Like this i Composer.json?
– Guilherme Nascimento
Check out the Composer.lock.
– Diego Braga