ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Problem in generating pdf through plugin....

June 29, 2009 1:46am

Subscribe [2]
  • #1 / Jun 29, 2009 1:46am

    zombica

    19 posts

    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%”>Invoice <?=$caseView->caseId;?>

          <?= date(‘F d, Y’, mysql_to_unix($caseView->date_created));?>
      </td>
      <td>

    <?= $caseView->case_name;?>

       
          <?= $caseView->lfname;?><?= $caseView->llname;?>
          <?= $caseView->tfname;?><?= $caseView->tlname;?>
          <?= $caseView->detail;?>,
          <?= $caseView->case_status;?>
       
      </td>
      </tr>
    </table>
    <? endforeach;?>
    <? $name;
    exit;
    ?>
    <? include(“layouts/Adminfooter.php”);?>
    ..........................

    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 / Jun 29, 2009 2:38am

    zombica

    19 posts

    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 / Jun 29, 2009 3:25am

    Thorpe Obazee

    1138 posts

    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.

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

  • #4 / Jun 29, 2009 3:35am

    zombica

    19 posts

    Thanx i got that….
    Regards…
    Zombica

  • #5 / Jun 29, 2009 10:34am

    johnwbaxter's avatar

    johnwbaxter

    651 posts

    Why don’t you take a look at the code for bambooinvoice.org which uses this pdf lib?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases