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:
Is there a log I can check? What can this work do on mac (using preview) but not on Adobe?
Edit
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
$this->load->helper('htm_to_pdf');
$data['data'] = $this->home_model->getReport(array('id'=>$id));
$html = $this->load->view('HTML2PDF/Code/index', $data, true);
pdf_create($html, 'filename');
}
+3
source to share
3 answers
Some wiki usage information
require_once("dompdf_config.inc.php");
$html_to_string = $this->load->view('', array(), true);
$dompdf = new DOMPDF();
$dompdf->load_html($html_to_string);
force_download('sample.pdf', file_get_contents($dompdf->render()));
-
Instead of loading force, you can use
$dompdf->stream("sample.pdf");
0
source to share
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: http://code.google.com/p/dompdf/issues/detail?id=418
0
source to share