[eluser]exodus7[/eluser]
Hey guys, I've been having some trouble generating a pdf file using dompdf. After following the steps in the wiki to setup domPDF and generate a pdf, i'm getting an error: "Fatal error: Class 'DOMPDF' not found in /html/system/plugins/to_pdf_pi.php on line 6". I've done everything I know from checking the file paths and permissions, but I'm suck in a rut....
Here is what the to_pdf_pi.php file looks like:
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
function pdf_create($html, $filename, $stream=TRUE)
{
require_once("system/plugins/dompdf/dompdf_config.inc.php");
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
if ($stream) {
$dompdf->stream($filename.".pdf");
} else {
write_file("html/www/pdf_temp/employment_$filename.pdf", $dompdf->output());
}
}
?>
Here's my Controller:
Code:
function generate_jobs()
{
$data['css'] = $this->css;
$data['base'] = $this->base;
$data['pgtitle'] = 'Generate PDF';
$this->db->where('active','y');
$this->db->order_by('post_date','desc');
$data['query'] = $this->db->get('employment');
$this->load->helper('file');
$this->load->plugin('to_pdf');
$html = $this->load->view('ccJobPostingGenerator', $data, true);
pdf_create($html, 'filename');
}
Here's the view file:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Job Postings</title>
</head>
<body>
<h1>Current Job Postings</h1>
<hr />
<?php foreach ($query as $row): ?>
<table width="800" border="0">
<tr>
<td width="300">Job Title</td>
<td><?=$row->job_title;?></td>
</tr>
<tr>
<td width="300">Job Number </td>
<td><?=$row->job_num;?></td>
</tr>
<tr>
<td width="300">Posting Date</td>
<td><?=$row->post_date;?></td>
</tr>
<tr>
<td width="300">Department</td>
<td><?=$row->department;?></td>
</tr>
<tr>
<td width="300">Basic Fuctions</td>
<td><?=$row->basic_functions;?></td>
</tr>
<tr>
<td width="300">Salary</td>
<td><?=$row->salary;?></td>
</tr>
<tr>
<td width="300">Hours</td>
<td><?=$row->hours;?></td>
</tr>
<tr>
<td width="300">Resume Deadline</td>
<td><?=$row->resume_deadline;?></td>
</tr>
<tr>
<td width="300">Location</td>
<td><?=$row->location;?></td>
</tr>
<tr>
<td width="300">Preferred Requirements</td>
<td><?=$row->require_prefer;?></td>
</tr>
<tr>
<td width="300">Minimum Requirements</td>
<td><?=$row->require_minimum;?></td>
</tr>
<tr>
<td width="300">Contact Name</td>
<td><?=$row->c_nam;?>e</td>
</tr>
<tr>
<td width="300">Contact Address</td>
<td><?=$row->c_address;?></td>
</tr>
<tr>
<td width="300">Contact Phone</td>
<td><?=$row->c_phone;?></td>
</tr>
<tr>
<td width="300">Contact Fax</td>
<td><?=$row->c_fax;?></td>
</tr>
<tr>
<td width="300">Contact Email</td>
<td><?=$row->c_email;?></td>
</tr>
<tr>
<td width="300">Active</td>
<td><?=$row->active;?></td>
</tr>
</table>
<br />
<hr />
<br />
<?php endforeach;?>
</body>
</html>