0

我正在使用phpwkhtmltopdf包将我的 html 转换为 PDF。如何将 .blade.php 转换为 pdf?

我试过这个

$pdf = new Pdf;
$pdf->addPage('temp');
$pdf->saveAs('test2.pdf');

但它不起作用并给我以下错误:

QSslSocket:无法解析 SSLv3_client_method QSslSocket:无法解析 SSLv3_server_method 错误:加载页面失败http:///var/www/html/project/views/temp(有时它可以通过 --load-error-handling ignore 忽略此错误) 由于网络错误而退出代码 1:HostNotFoundError

4

1 回答 1

0

好的,我找到了解决方案,您可以像这样使用 View()

$pdf->addPage(View('temp'));

或者

$view= view('temp')->render();
$pdf->addPage($view);
于 2017-05-23T15:23:27.463 回答