Enrique Benitez
Enrique Benitez

Reputation: 679

DOMPDF outputs bad html on Linux

UPDATE1: Works pretty well on Ubuntu but not on CentOS.

I have a issue with the DOMPDF on CentOS Linux VPS,

I output an HTML with css on my WAMPP and works pretty well:

enter image description here But when i upload the same code, the same html it shows as this:

enter image description here

I tried everything like check encoding, inline css, enabling remote but still no way to get this running, here is my code:

                    require_once(APP . 'vendors' . DS . 'dompdf' . DS . 'dompdf_config.inc.php'); 
                spl_autoload_register('DOMPDF_autoload'); 
                $dompdf = new Dompdf();
                def("DOMPDF_ENABLE_REMOTE", true);
                $_GET['print'] = 1;
                $dompdf->set_paper("A4", "portrait");
                $this->output = '';
                $this->layout = 'none';
                $old_output = $this->output;
                $this->render('innobra_pdf');
                $new_output = $this->output;
                $dompdf->load_html($new_output);
                // $dompdf->load_html( utf8_decode($new_output), Configure::read('App.encoding') );
                $dompdf->render();
                $output = $dompdf->output();
                header('Content-type: application/pdf');
                echo $output; die();

What i'm doing wrong ?

Thanks

Upvotes: 1

Views: 1258

Answers (1)

If you have copied to another server, try deleting the file

dompdf/lib/fonts/dompdf_font_family_cache.php

Upvotes: 2

Related Questions