Welcome Guest, Not a member yet? Register   Sign In
Problem in generating pdf through plugin....
#1

[eluser]zombica[/eluser]
Hey guys i m using a pdf generation plugin available for CI.

Available over here http://www.digitaljunkies.ca/dompdf/downloads.php#doc

Problem is that :
Here is my controller class pdf function

function pdf($cid)
{
$this->load->plugin('to_pdf');
$this->load->helper('typography');

$data['pageTitle'] = 'Case Detail';

$caseInfo = $this->casemodel->get_single_case($cid);
$data['singlecaseView'] = $this->casemodel->get_single_case($cid);
$data['row'] = $this->casemodel->get_single_case($cid);

$html = $this->load->view('pdf', $data, true);exit;
pdf_create($html, 'case_'.$data['row']->caseId);

}



...............................................
and here is my view pdf file code

<? include("layouts/Adminheader.php");?>
<? foreach($singlecaseView as $caseView):?>
<table cellpadding="0" cellspacing="0" border="0" width="800">
<tr>
<td width="60%"><p><strong>Invoice &lt;?=$caseView->caseId;?&gt;</strong><br />
<strong>&lt;?= date('F d, Y', mysql_to_unix($caseView->date_created));?&gt;</strong></p>
</td>
<td><h2>&lt;?= $caseView->case_name;?&gt;</h2>
<p>
&lt;?= $caseView->lfname;?&gt;&lt;?= $caseView->llname;?&gt;
&lt;?= $caseView->tfname;?&gt;&lt;?= $caseView->tlname;?&gt;
&lt;?= $caseView->detail;?&gt;,
&lt;?= $caseView->case_status;?&gt;
</p>
</td>
</tr>
</table>
&lt;? endforeach;?&gt;
&lt;? $name;
exit;
?&gt;
&lt;? include("layouts/Adminfooter.php");?&gt;
..........................

problem is that in controller function pdf() it loads my view page and displays all the data on view page but it does not reads pdf_create($html, 'case_'.$data['row']->caseId); function and does not comes into it.

Is some thing i am missing and where does this pdf file will be generated. Where can i see my pdf generated file.

Thanx in advance.
Regards.....
#2

[eluser]zombica[/eluser]
Hey Guys does PDF generation plugin support for CI given by Derek Allard...
Does not support tables,tr,td. Do i have to use only the paragraph, headings, li or some thing like this.
#3

[eluser]Thorpe Obazee[/eluser]
[quote author="zombica" date="1246271936"]Hey Guys does PDF generation plugin support for CI given by Derek Allard...
Does not support tables,tr,td. Do i have to use only the paragraph, headings, li or some thing like this.[/quote]

The library is dompdf by http://code.google.com/p/dompdf/. It has support for tables.
#4

[eluser]zombica[/eluser]
Thanx i got that....
Regards...
Zombica
#5

[eluser]johnwbaxter[/eluser]
Why don't you take a look at the code for bambooinvoice.org which uses this pdf lib?




Theme © iAndrew 2016 - Forum software by © MyBB