【问题标题】:laravel 5 html to pdf view issuelaravel 5 html 到 pdf 查看问题
【发布时间】:2016-03-01 04:32:09
【问题描述】:

我正在尝试输入 html 并将其另存为 pdf。但是,似乎 pdf 中的内容渲染得不好。我正在使用来自maatwebsite 的插件。这是我尝试过的代码

控制器

Excel::create('test',function($file){
        $file->sheet('Sheet1', function ($sheet){

            $sheet->loadView('excel');
            $sheet->setAutoSize(true);
        });

    })->store('pdf',storage_path('uploaded-excel'));

查看

<body>
    <p>test</p>
    <img src="images/hierarchy.png"/>
</body>

结果

但是当我删除img标签时,尺寸本身看起来很正常

我错过了什么?

【问题讨论】:

    标签: php pdf laravel-5 mpdf maatwebsite-excel


    【解决方案1】:

    我使用 https://github.com/barryvdh/laravel-dompdf 插件而不是使用 maatwebsite 的内置函数

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-06-09
      • 1970-01-01
      • 2015-11-28
      • 1970-01-01
      • 2015-04-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多