gpt4 book ai didi

php - 防止Wkhtmltopdf输出Status

转载 作者:行者123 更新时间:2023-12-05 05:26:14 26 4
gpt4 key购买 nike

我正在使用 WKHTMLTOPDF用于将 html 页面转换为 pdf。我写了下面的代码。

system("wkhtmltopdf http://localhost/advisory_system/frontend/index.php/Analysis/fpdf /opt/lampp/htdocs/pdf_testo/test1/pdf_final_testA_$i.pdf  2>&1");

在我的 PHP 脚本中使用上述脚本时,它会输出状态,例如:

Loading pages (1/6) [> ] 0% [======> ] 10% [=========> ] 15% [==========> ] 18% [============> ] 21% [=================> ] 29% [========================> ] 41% [==========================> ] 44% [==============================> ] 50% [============================================================] 100% Counting pages (2/6) [============================================================] Object 1 of 1 Resolving links (4/6) [============================================================] Object 1 of 1 Loading headers and footers (5/6) Printing pages (6/6) [> ] Preparing [=====> ] Page 1 of 11 [==========> ] Page 2 of 11 [================> ] Page 3 of 11 [=====================> ] Page 4 of 11 [===========================> ] Page 5 of 11 [================================> ] Page 6 of 11 [=====================================> ] Page 7 of 11 [===========================================> ] Page 8 of 11` [================================================> ] Page 9 of 11 [======================================================> ] Page 10 of 11 [============================================================] Page 11 of 11 Done

如何防止 wkhtmltopdf 输出这种类型的状态?

版本是:0.12.1(打补丁的 qt)

最佳答案

最后我得到了解决方案,通过使用 exec PHP的功能。它只是执行命令而不发送输出 while system函数输出执行输出。所以我的脚本现在看起来像:

exec("wkhtmltopdf http://localhost/advisory_system/frontend/index.php/Analysis/fpdf /opt/lampp/htdocs/pdf_testo/test1/pdf_final_testA_$i.pdf  2>&1");

关于php - 防止Wkhtmltopdf输出Status,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27040832/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com