[eluser]aruntvla[/eluser]
*************to_pdf_pi.php*************************
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
function pdf_create($html, $filename, $stream=TRUE)
{
require_once("dompdf/dompdf_config.inc.php");
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
if ($stream) {
$dompdf->stream($filename.".pdf");
} else {
$CI =& get_instance();
$CI->load->helper('file');
write_file("./invoices_temp/invoice_$filename.pdf", $dompdf->output());
}
}
?>
**************************************************************
Controller page function
Code:
function pdf()
{
$this->load->plugin('to_pdf');
// page info here, db calls, etc.
$html = $this->load->view('user_printpreview', $this->data, true);
pdf_create($html, 'coupon');
}
*********************************************************************
View Page
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style2 {
font-size: 24px;
color: #FFFFFF;
}
.style4 {
font-size: 24px;
font-weight: bold;
}
.style5 {font-size: 24px; font-weight: bold; color: #FFFFFF; }
-->
</style>
</head>
<body>
<table width="595" height="842" border="1" cellpadding="0" cellspacing="0" align="center">
<tr>
<td height="83" bgcolor="#A42A2A"><span class="style4">
</span>
<div align="center" class="style5">Logo</div></td>
</tr>
<tr>
<td height="83" bgcolor="#A42A2A"><span class="style4">
</span>
<div align="center" class="style5">Coupons</div></td>
</tr>
<?php
if(isset($coupondetail))
{
for($i=0;$i<count($coupondetail);$i++)
{ ?>
<tr>
<td> <img >photo ; ?>" border="0" style="width: 108%;"/></td>
</tr>
<?php }} ?>
</table>
</body>
</html>
Error in Localhost : Broken mesages showing in pdf file
Error in server :
Code:
A PHP Error was encountered
Severity: Warning
Message: Division by zero
Filename: include/image_frame_reflower.cls.php
Line Number: 89
Code:
A PHP Error was encountered
Severity: Warning
Message: Division by zero
Filename: lib/class.pdf.php
Line Number: 4659
Please give me a suggestion??????????