问题描述
我在laravel项目中安装了browsershot 我已经安装了puppeteer,安装了chrome,我的npm版本已更新,但仍然无法获取我简单的html输入的PDF,我试图通过URL方法获取屏幕截图并另存为图像(有效),但是我的要求是生成我的html的PDF。
这是我在控制器中的代码
$output=browsershot::html($html)
->setNodeModulePath("/var/www/html/ProjectName/node_modules/")
->setChromePath("/usr/bin/chromium-browser")
->setNodeBinary('/usr/local/bin/node')
->setNpmBinary('/usr/local/bin/npm')
->showBackground()
->noSandBox()->timeout(60)
->save(public_path("DevTest.pdf");
错误消息:
“ message”:“进程” PATH = $ PATH:/ usr / local / bin NODE_PATH ='/ var / www / html / ProjectName / node_modules /'/ usr / local / bin / node'/ var / www /html/benesprint/vendor/spatie/browsershot/src/../bin/browser.js''{“ url”:“文件:\ / \ / \ / tmp \ / 1933874416-0068512001600765779 \ /index.html”, “ action”:“ pdf”,“ options”:{“ path”:“ \ / var \ / www \ / html \ / ProjectName \ / public \ /DevTest.pdf”,“ args”:[“-no- sandBox“],” viewport“:{” width“:800,” height“:600},” displayheaderfooter“:false,” executablePath“:” \ / usr \ / bin \ / chromium-browser“,”超时“: 60000,“ printBackground”:true}}'“超过了60秒的超时。”,
**i would be grateful if you can help me out.**
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)