Welcome Guest, Not a member yet? Register   Sign In
Need urgent help on dompdf
#3

[eluser]nandish[/eluser]
Hi guys am generating pdf document using dompdf library,the problem is,its not displaying data properly, means if the data contain 40 rows only 30 rows will be displayed in pdf document and the another ten rows will be displayed on the top of pdf document like a garbage text(i think its try to display whole data in a single page,why its not jump to second page) please help me.

Note:Am attaching pdf document please go through and help me


This is my view page

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&lt;HTML&gt;
&lt;HEAD&gt;

&lt;TITLE&gt;pdfformat&lt;/TITLE&gt;
&lt;META NAME="Generator" CONTENT="EditPlus"&gt;
&lt;META NAME="Author" CONTENT=""&gt;
&lt;META NAME="Keywords" CONTENT=""&gt;
&lt;META NAME="Description" CONTENT=""&gt;
&lt;style type="text/css"&gt;
body {
background-color:white;
font-family:arial;
color:black;
}
td{

padding-left:2px;
padding-right:1px;
}


&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form&gt;
<table border='1' cellspacing='0' cellpadding='0' width='580' align='center'>
<tr><td colspan='8' align='center'><h2>Roster Details</h2></td></tr>
&lt;?php
if(count($res)>0){
?&gt;
<tr id="col">
<td align ='center'>Jersey Num</td>
<td align = 'center'>Name</td>
<td align = 'center'>Offensive</td>
<td align = 'center'>Defensive</td>
<td align = 'center'>Grade</td>
<td align = 'center'>Height</th>
<td align = 'center'>Weight</td>
<td align = 'center'>Ltr</td>
</tr>
&lt;?php
foreach ($res as $item){
echo "<tr>";
echo "<td align = 'left' style='padding-left:4px;'>".$item['i_number']."</td>";
echo "<td align = 'left' style='padding-left:5px;' >".$item['s_first_name']." " .$item['s_last_name']."</td>";
echo "<td align = 'center' >";
if($item['s_off_pos'] == "")
echo "-";
else
echo $item['s_off_pos'];
echo "</td>";
echo "<td align = 'center' >";
if($item['s_def_pos'] == "")
echo "-";
else
echo $item['s_def_pos'];
echo "</td>";
echo "<td align = 'center' >";
if($item['s_grade'] == "")
echo "-";
else
echo $item['s_grade'];
echo "</td>";
echo "<td align = 'center' >";
if( $item['s_height'] == "")
echo "-";
else
echo $item['s_height'];
echo "</td>";
echo "<td align = 'center' >";
if($item['s_weight'] == "")
echo "-";
else
echo $item['s_weight'];
echo "</td>";
echo "<td align = 'center' >".$item['i_ltr']."</td>";
echo "</tr>";
}
}
?&gt;
</table>
&lt;/form&gt;
&lt;/body&gt;

This is my controller

function generatePdf(){
if(!$this->sehelper->checkSession())
return;
$schoolid = $this->sehelper->getUserSchoolID();
$this->load->plugin('to_pdf');

$cu_year=$this->uri->segment(3);

$qteamid=$this->uri->segment(4);

$status=$this->uri->segment(5);

$data['year'] =$cu_year;

$data['teamid'] = $qteamid;

$data['status'] = $status;

$data['res'] = $this->MRoster->selectAll($qteamid,$status,$cu_year);

$html=$this->load->view('vrpdf',$data,true);

pdf_create($html,'Roster_'.$schoolid,true);
}


this is my plugin file

&lt;?php if (!defined('BASEPATH')) exit('No direct script access allowed');
function pdf_create($html, $path, $filename,$stream = TRUE) {
require_once("dompdf/dompdf_config.inc.php");
ini_set("memory_limit","32M");
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$pdf=$dompdf->output();
if($stream){
$dompdf->stream($filename.".pdf");}
}
?&gt;


I can able to generate pdf document but only the problem is, the data will not display properly.its try to display whole data in one page why its not displaying data in second page...please help me

Thanks guys...


Messages In This Thread
Need urgent help on dompdf - by El Forum - 05-24-2008, 03:42 AM
Need urgent help on dompdf - by El Forum - 05-24-2008, 03:57 AM
Need urgent help on dompdf - by El Forum - 05-24-2008, 05:20 AM
Need urgent help on dompdf - by El Forum - 05-24-2008, 02:28 PM
Need urgent help on dompdf - by El Forum - 05-24-2008, 02:33 PM
Need urgent help on dompdf - by El Forum - 05-26-2008, 03:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB