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

[eluser]nandish[/eluser]
Hi guys i had got a problem while generating pdf document using dompdf in code igniter.


I can able to generate pdf doucment and bla,bla.but the probelm is when i open pdf document its not displaying properly.means if the the result contain 40 rows its only display 30 rows and another 10 rows will display on top of the pdf doument like a garabage text.

this is my view file

<!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;
&lt;/html&gt;
#2

[eluser]nandish[/eluser]
Hi guys please help me,I generate pdf document using dompdf,but the the problem is its not displaying properly,means if the data contain 40 rows it will display only 30 rows in the pdf document and another 10 rows will displayed on the top of pdf document like a garbage text

Thanks.

This 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;
&lt;/html&gt;
#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...
#4

[eluser]Derek Allard[/eluser]
This is a bug I found and squashed in BambooInvoice, but the truth is I don't recall how I did it. A user helped me out, you can probably find the solution on the BambooInvoice Forums if you want to poke.

If not, you could grab Bamboo and compare the files.
#5

[eluser]Derek Allard[/eluser]
Also, no need to post essentially the same thing 3 times. We're pretty diligent around here. I've merged them all into this one thread. If you would like me to delete any of them, I'd be happy to do so.
#6

[eluser]nandish[/eluser]
I had got solution.The problem is table structure... :-)




Theme © iAndrew 2016 - Forum software by © MyBB