wkhtmltopdf with javascript-delay not working

China☆狼群 提交于 2019-12-06 12:13:08

Found the problem after searching for hours. wkhtmltopdf stops slow scripts:

Loading pages (1/6)
Warning: A slow script was stopped                                
Counting pages (2/6)                                               
Resolving links (4/6)                                                       
Loading headers and footers (5/6)                                           
Printing pages (6/6)

So I needed to use the flag --no-stop-slow-scripts:

$command = shell_exec("xvfb-run -a -s '-screen 0 640x480x16' wkhtmltopdf-i386 --no-stop-slow-scripts --dpi 300 --page-size A4 $page /tmp
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!