I want to use dompdf i've downloaded from github and extracted on my webserver but i face error as, (i'm on windows).I also tried this but didn't help
define('DOMPDF_ENABLE_AUTOLOAD', false);
<br />
<b>Fatal error</b>: Class 'DOMPDF' not found in
<b>C:\xampp\htdocs\Rental\controlleregister.php</b> on line <b>38</b><br />
here's my code
if(!empty($_POST['pr_data'])){
$pr_dt=$_POST['pr_data'];
require_once("../assets/converter/dompdf/dompdf_config.inc.php");
$dompdf = new DOMPDF();
$dompdf->load_html($pr_dt);
$dompdf->render();
$dompdf->stream("sample.pdf");
echo $dompdf;
exit;
}
jQuery('.btn-print').click(function() {
var pr_data = jQuery('.tc').html();
jQuery.post('../controller/register.php', {
'pr_data': pr_data
}, function(result) {
console.log(result);
});
});
I downloaded dompdf from dompdf i didn't use composer for installing i've used third one Download and extract
UPDATE I've also tried checking whether dompdf file path is correct
if(!@include("../assets/converter/dompdf/dompdf_config.inc.php")) throw new Exception("Failed to include 'script.php'");
and check whether class exist
if (class_exists('dompdf'))
{
echo "class exist";
}
else{
echo "does not exist";
}
if (is_file("../assets/converter/dompdf/dompdf_config.inc.php"))
{
echo "PATH is CORRECT";
require_once("../assets/converter/dompdf/dompdf_config.inc.php");
}
now the output
does not exist PATH is CORRECT
Fatal error: Class 'DOMPDF' not found in
C:\xampp\htdocs\Rental\view\createMRA.php on line 83
Update
I'm able to download a corrupt pdf why so?
Fatal error: Class 'Font' not found in C:\xampp\htdocs\Rental\assets\converter\dompdf\include\font_metrics.cls.php on line 346