DOM PDF on Mac, but not PC

I am using DOM PDF to convert a simple html page to PDF file - everything works on Mac, but on PC I get the message: PDF error on windows

Is there a log I can check? What can this work do on mac (using preview) but not on Adobe?


As bfavaretto suggested, I opened the PDF in text format. Here's the error:

<p>Message:  Function set_magic_quotes_runtime() is deprecated</p>
<p>Filename: lib/class.pdf.php</p>
<p>Line Number: 4332</p>


Here is my CI code:

function pdf($id)
        // Setup fields
        $data['data'] = $this->home_model->getReport(array('id'=>$id));
        $html = $this->load->view('HTML2PDF/Code/index', $data, true);
        pdf_create($html, 'filename');



source to share

3 answers

Some wiki usage information


$html_to_string = $this->load->view('', array(), true);

$dompdf = new DOMPDF();

force_download('sample.pdf', file_get_contents($dompdf->render()));



Instead of loading force, you can use






no longer used in dompdf 0.6. I suggest you download the latest version (0.6 beta 3) or remove the call set_magic_quotes_runtime

in lib/class.pdf.php


This is a warning raised by PHP because this function is deprecated.



I have seen reports of similar problems (I had a lot of problems with DOMPDF), it looks like there is other text in the output stream that causes Acrobat to reject the PDF as corrupted.

Try adding setlocale (LC_NUMERIC, "C"); before calling DomPDF Take a look at this thread for more info:



All Articles