简体   繁体   English

MPDF无法在exeoutput中工作

[英]mpdf not working in exeoutput

I am trying to convert PHP Web application to desktop application using ExeOutput for PHP 2018 . 我正在尝试使用适用于PHP 2018的ExeOutput将PHP Web应用程序转换为桌面应用程序。 I have tried compiling with PHP 5.6, 7.1 and 7.2 我尝试使用PHP 5.6、7.1和7.2进行编译

I have tried using mpdf 6.x and 7.x 我尝试使用mpdf 6.x和7.x

in all the cases, I get a grey window with a popup message : "Failed to load pdf document." 在所有情况下,我都会看到一个带有弹出消息的灰色窗口:“无法加载pdf文档。”

The same code works fine when I run the same application in a web browser. 当我在Web浏览器中运行相同的应用程序时,相同的代码可以正常工作。

Following is my code: 以下是我的代码:

require_once '../mpdf/vendor/autoload.php';
$mpdf = new \Mpdf\Mpdf();
$mpdf->WriteHTML($a);
$mpdf->SetJS('this.print();');
$mpdf->Output();
exit;

Please help 请帮忙

Try downloading the latest mpdf library (7.x) from github, make it using composer so that you get the vendor directory and then try compiling application with 7.x version. 尝试从github下载最新的mpdf库(7.x),并使用composer进行下载,以获取供应商目录,然后尝试使用7.x版本编译应用程序。 Use the same pdf generation code. 使用相同的pdf生成代码。 Things will go fine. 一切都会好起来的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM