本文介绍了Codeigniter 2中的cezPDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用CodeIgniter 2中的cezPDF库但似乎无法打印表或ezTable无法正常工作有人遇到过这个吗?或对此有任何解决方案?在这里看看我的代码:

I am using cezPDF library in CodeIgniter 2But it seems it can't print the table or ezTable isn't working properlyAnyone faced this before? or any solution on that?take a look at my code here:

$db_data [] = array ('name' => 'x' );
$db_data [] = array ('name' => 'y' );
$db_data [] = array ('name' => 'z' );
$col_names = array ('name' => 'col' );
$this->cezpdf->ezTable ( $db_data, $col_names, '', array ('width' => 180, 'xPos' => 140 ) );

推荐答案

您忘记写此指令了

$this->cezpdf->ezStream();

顺便说一下,这是一个可行的例子

By the way this is a working example

$this->load->library('cezpdf');

$db_data[] = array('name' => 'Jon Doe', 'phone' => '111-222-3333', 'email' => 'jdoe@someplace.com');
$db_data[] = array('name' => 'Jane Doe', 'phone' => '222-333-4444', 'email' => 'jane.doe@something.com');
$db_data[] = array('name' => 'Jon Smith', 'phone' => '333-444-5555', 'email' => 'jsmith@someplacepsecial.com');

$col_names = array(
    'name' => 'Name',
    'phone' => 'Phone Number',
    'email' => 'E-mail Address'
);

$this->cezpdf->ezTable($table_data, $col_names, 'Contact List', array('width'=>550));
$this->cezpdf->ezStream();

这篇关于Codeigniter 2中的cezPDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 11:29