【问题标题】:Php to pdf conversion using ezpdf?使用ezpdf将php转换为pdf?
【发布时间】:2015-08-02 20:30:50
【问题描述】:

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

<?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();
    }
}

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

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:

我该如何解决这个问题???任何帮助将不胜感激..

【问题讨论】:

    标签: php codeigniter pdf ezpdf


    【解决方案1】:

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

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

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

    【讨论】:

    • 如果我给类名 Hello...我可以通过任何方式在 localhost 中调用它为什么会很重要...
    猜你喜欢
    • 1970-01-01
    • 2012-01-27
    • 2017-01-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-09
    相关资源
    最近更新 更多