小编dro*_*lan的帖子

wkhtmltopdf ContentNotFoundError,代码1

我正在尝试使用wkhtmltopdf phpwrapper 生成基本的pdf .我也在使用yii框架.

这是我的HTML:

<!doctype html>
<html>
    <head>
    </head>

    <body> 
            <p>test</p>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

我在wktmltopdf中的设置:

$pdfParams = array(

            'header-html' => $this->tmpHeaderFile->getFileName(),
            'footer-html' => $this->tmpFooterFile->getFileName(),

            'username' => 'myUser',
            'password' => 'myPass',
        );
 $this->pdf = new Pdf($pdfParams);
Run Code Online (Sandbox Code Playgroud)

我得到的错误:

Exception 'Exception' with message 'Could not create PDF: Loading pages (1/6)
[>                                                           ] 0%
[======>                                                     ] 10%
[==============================>                             ] 50%
[============================================================] 100%
Counting pages (2/6)                                               
[============================================================] Object 1 of 1
Resolving links (4/6)                                                       
[============================================================] Object 1 of 1
Loading headers and footers (5/6) …
Run Code Online (Sandbox Code Playgroud)

php yii wkhtmltopdf yii2

6
推荐指数
1
解决办法
1378
查看次数

标签 统计

php ×1

wkhtmltopdf ×1

yii ×1

yii2 ×1