doutu1939 2016-03-14 11:53
浏览 55

在codeigniter中创建和下载pdf

I am using codeigniter and creating a functionality for generate and dwonload pdf. when i implement it on local host its working very fine. but its not working on live server (its not taking array(width=>550). I am in hurry please help me Thanks in advance Here is my code please check it

public function invoice_pfd(){


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

        prep_pdf(); // creates the footer for the document we are creating.
        $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($db_data, $col_names, 'My Invoice', array('width' => 1550 ));
        $this->cezpdf->ezStream();

        //$data['social'] = $this->Business_model->social_data();

    }
  • 写回答

1条回答 默认 最新

  • dongshuobei1037 2016-03-14 12:15
    关注

    This might help you ..

    <?php
        function tables()
        {
            $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();
        }
    ?>
    

    This is not based on your question. but it can might help you .

    For more info click here This another library is also helpful, Check here

    评论

报告相同问题?

悬赏问题

  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 组策略中的计算机配置策略无法下发
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
  • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)
  • ¥50 mac mini外接显示器 画质字体模糊