【问题标题】:"The system cannot find the path specified. " stdout: "" command: /usr/local/bin/wkhtmltopdf"系统找不到指定的路径。" stdout: "" command: /usr/local/bin/wkhtmltopdf
【发布时间】:2019-10-10 04:21:20
【问题描述】:

我正在使用这个包 https://github.com/barryvdh/laravel-snappy

要生成 pdf 文件,我会按照文档进行安装,但出现此错误

配置/snappy.php

<?php

return array(


    'pdf' => array(
        'enabled' => true,
        'binary'  => base_path('vendor/h4cc/wkhtmltopdf-i386/bin/wkhtmltopdf-i386'),
        'timeout' => false,
        'options' => array(),
        'env'     => array(),
    ),
);

打印控制器

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use PDF;
use App\Caisse;

class PrintController extends Controller
{
    public function testPdf()
    {
        $caisse = Caisse::where('type',1)->first();
        $pdf = PDF::loadView('print.test',[
            'date' => date('M-Y'),
            'caisse' => $caisse,
            ]);
        return $pdf->download('invoice.pdf');
    }
}

错误图片

【问题讨论】:

    标签: laravel


    【解决方案1】:

    一个现金问题:(我用这个解决了它

    php artisan config:cache
    php artisan cache:clear
    

    【讨论】:

      猜你喜欢
      • 2019-04-29
      • 2013-04-22
      • 2021-03-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-23
      • 2018-12-12
      相关资源
      最近更新 更多