doufei7464 2015-09-23 12:36 采纳率: 0%
浏览 90

在laravel 5.1中集成HTML2PDF

I am trying to integrate html2pdf library in laravel 5.1. But it is showing error like as follows Class 'App\Http\Controllers\HTML2PDF' not found and my controller code is as follows

require_once(dirname(__FILE__).'/libs/html2pdf/html2pdf.class.php');
$html2pdf = new HTML2PDF('P','A4','en',true,'UTF-8',array(0, 0, 0, 0));
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->WriteHTML($html22);

my folder path is app/Http/Controllers/libs/html2pdf/html2pdf.class.php

i had given the correct path but still it is showing error like HTML2PDF not found. Please anyone let me know how to integrate html2pdf ? or should i do any changes in compose.json file ?

and even i included the line App\Http\Controllers\HTML2PDF at the top of the Controller page but no use.

please help me out .

Thanks

  • 写回答

2条回答 默认 最新

  • 普通网友 2015-09-23 12:44
    关注

    I just downloaded the latest and it would seem there is no namespace.

    Remove the use App\Http\Controllers\HTML2PDF and try instantiating html2pdf like $html2pdf = new \HTML2PDF('P','A4','en',true,'UTF-8',array(0, 0, 0, 0));

    评论

报告相同问题?

悬赏问题

  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥30 python代码,帮调试,帮帮忙吧