0

我想使用ezPDFin codeigniter 创建一个简单的 pdf。我正在关注这篇文章。我的控制器代码如下所示:

<?php
class Hello extends CI_Controller {
    function index()
    { 
        $this->load->library('Cezpdf');
        $this->Cezpdf->ezText('Hello World', 12, array('justification' => 'center'));
        $this->Cezpdf->ezSetDy(-10);

        $content = 'The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog.
        Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs.';

        $this->Cezpdf->ezText($content, 10);

        $this->Cezpdf->ezStream();
    }
}

我复制了应用程序目录中的Cezpdf.php和文件夹。所以现在我收到此错误:Cpdf.php/application/librariesfonts

A PHP Error was encountered

Severity: Error

Message: Call to a member function ezText() on a non-object

Filename: controllers/hello.php

Line Number: 6

Backtrace:

我怎样才能解决这个问题???任何帮助,将不胜感激..

4

1 回答 1

0

他们使用了 Hello World,但您使用 Hello 作为类名,请查看他们的文章

 $this->Cezpdf->ezText('Hello World', 12, array('justification' => 'center'));

http://christophermonnat.com/blog/generating-pdf-files-using-codeigniter

于 2015-05-21T09:26:36.803 回答