Laravel 活泼的错误代码 1073741819 - 正在加载页面 1/6

Laravel snappy error code 1073741819 - Loading pages 1/6

OS:Windows 10 pro

PHP: 7.3.5

Laravel: 5.8

我已经根据作曲家的建议安装了以下软件包

  "barryvdh/laravel-snappy": "^0.4.4",
    "h4cc/wkhtmltopdf-i386": "0.12.4",
    "wemersonjanuario/laravelpdf": "1.1.*",
    "wemersonjanuario/wkhtmltopdf-windows": "0.12.2.3"

二进制路径

'pdf' => array(
        'enabled' => true,
        'binary'  => '"C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf"',
        'timeout' => false,
        'options' => array(),
        'env'     => array(),
    ),

显示错误

"The exit status code '-1073741819' says something went wrong:↵stderr: "Loading pages (1/6)
↵[>                                                           ] 0%
[======>                                                     ] 10%
QNetworkAccessFileBackendFactory: URL has no schema set, use file:// for files
↵QNetworkAccessFileBackendFactory: URL has no schema set, use file:// for files
↵[========>                                                   ] 14%
[=============>                                              ] 23%
"↵stdout: ""↵command: "C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf" --lowquality "C:\Users\DELL~1.DES\AppData\Local\Temp\knp_snappy5d2ee6e73b39b3.84603457.html" "D:\work\www\myapp/public/job-cards/job-card-1-07-17-2019_0914am.pdf"."
trace: [{file: "D:\work\www\myapp\vendor\knplabs\knp-snappy\src\Knp\Snappy\AbstractGenerator.php",…},…]

更新

C:\Program Files\wkhtmltopdf\bin>wkhtmltopdf http://www.google.com test.pdf
Loading pages (1/6)
QPainter::begin(): Returned false============================] 100%
Error: Unable to write to destination
Exit with code 1, due to unknown error.

命令行也给出同样的错误。

您是否检查了 Laravel snappy 包使用的库的 github 问题?那里报告了一些类似的问题。由于您没有提到有关您所面临问题的场景的足够详细信息,因此很难提出直接的解决方案。

请检查以下问题,您可能会找到解决方案。

  1. https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1873
  2. https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1570
  3. https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1512

此问题是因为 google.com 页面中存在 JS,仅使用 html 内容,它工作正常。