php - HTML To PDF Converter dompdf -


i want use dompdf i've downloaded github , extracted on webserver face error as, (i'm on windows).i tried didn't help

      define('dompdf_enable_autoload', false);       <br />      <b>fatal error</b>:  class 'dompdf' not found in                  <b>c:\xampp\htdocs\rental\controller\register.php</b> on line <b>38</b><br /> 

here's 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 dompdf didn't use composer installing i've used third 1 download , extract

update i've tried checking whether dompdf file path correct

   if(!@include("../assets/converter/dompdf/dompdf_config.inc.php")) throw new exception("failed 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 correct";         require_once("../assets/converter/dompdf/dompdf_config.inc.php");     } 

now output

      not exist path correct       fatal error: class 'dompdf' not found in                    c:\xampp\htdocs\rental\view\createmra.php on line 83 

update

i'm able download 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 

try including file dompdf_inc_dir/dompdf.cls.php working file. dompdf class defined.

hope resolve issue.

-naim


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -