图像未在PDF生成器上加载

时间:2014-01-28 06:55:55

标签: php codeigniter pdf-generation

我使用cezpdf在代码点火系统中生成报告, 以下是应该生成报告的函数:

function patients()
    {
        $this->load->library('cezpdf');
        //$this->load->helper('pdf_helper');

        //prep_pdf();
        $db=$this->reports->all_patients();
        foreach($db as $pats){

        $table[] = array('f_name' => $pats['f_name'], 'other_name' =>$pats['other_name'] , 's_name' => $pats['s_name'], 'phone_no'=> $pats['phone_no'],'email'=> $pats['email']);
        }

        $col_names = array(
            'f_name' => 'First Name',
            'other_name' => 'Last Name',
            's_name' => 'Surname',
            'phone_no' => 'Phone Number',
            'email' => 'E-mail Address'
        );

                 $image=BASEPATH.'img/shwari.jpg';
                    $this->cezpdf->ezImage($image);
                    $this->cezpdf->ezSetMargins(50,50,50,50);
                    $this->cezpdf->addText(50,32,8,'Printed on ' . date('m/d/Y h:i:s a'). ' copyright Shwari Healthcare System KE');

        //  $this->cezpdf->addJpegFromFile("shwari.jpg",25,20,40,20);
        $this->cezpdf->ezTable($table, $col_names, 'All Patients', array('width'=>550));
        $this->cezpdf->ezStream();



        }

我已设法生成报告,但我尝试加载到报告中的图像并未采摘。加载图像的最佳方法是什么?

0 个答案:

没有答案