【问题标题】:wkhtmltopdf rendering twice?wkhtmltopdf 渲染两次?
【发布时间】:2016-07-03 01:09:53
【问题描述】:

我正在使用 wicked_pdf,工作正常。但是,服务器似乎只为一次调用渲染/执行 wicked 两次,从而产生一个 pdf 文件。谁能告诉我为什么?服务器日志如下所示:

    2016-03-16T21:53:11.659341+00:00 app[web.1]: Started GET "/wpdf" for 99.99.99.99 at 2016-03-16 21:53:11 +0000
2016-03-16T21:53:11.661184+00:00 app[web.1]: Processing by SomeStoriesController#wpdf as HTML
2016-03-16T21:53:11.661632+00:00 app[web.1]: ***************WICKED***************
2016-03-16T21:53:11.663620+00:00 app[web.1]:   Rendered some_stories/wpdf.html.erb (1.1ms)
2016-03-16T21:53:13.128754+00:00 heroku[router]: at=info method=GET path="/wpdf" host=xxxx.herokuapp.com request_id=3ca3a32a-2c40-4052-b7fb-8d333b7277c6 fwd="99.99.99" dyno=web.1 connect=0ms service=1477ms status=200 bytes=18490
2016-03-16T21:53:13.132369+00:00 app[web.1]:   Rendered text template (0.0ms)
2016-03-16T21:53:13.132480+00:00 app[web.1]: Sent data file_name.pdf (0.5ms)
2016-03-16T21:53:13.132673+00:00 app[web.1]: Completed 200 OK in 1471ms (Views: 0.4ms | ActiveRecord: 0.0ms)
2016-03-16T21:53:13.362617+00:00 app[web.1]: Started GET "/wpdf" for 99.99.99.99 at 2016-03-16 21:53:13 +0000
2016-03-16T21:53:13.363827+00:00 app[web.1]: Processing by SomeStoriesController#wpdf as HTML
2016-03-16T21:53:13.364250+00:00 app[web.1]: ***************WICKED***************
2016-03-16T21:53:13.365987+00:00 app[web.1]:   Rendered some_stories/wpdf.html.erb (1.1ms)
2016-03-16T21:53:14.468550+00:00 heroku[router]: at=info method=GET path="/wpdf" host=xxxx.herokuapp.com request_id=5b70cf38-bc29-45fd-8287-3a01b0b1372a fwd="99.99.99.99" dyno=web.1 connect=0ms service=1114ms status=200 bytes=18490
2016-03-16T21:53:14.472015+00:00 app[web.1]:   Rendered text template (0.0ms)
2016-03-16T21:53:14.472110+00:00 app[web.1]: Sent data file_name.pdf (0.4ms)
2016-03-16T21:53:14.472271+00:00 app[web.1]: Completed 200 OK in 1108ms (Views: 0.3ms | ActiveRecord: 0.0ms)

【问题讨论】:

  • 这里有同样的问题。有什么发现吗?

标签: ruby-on-rails wkhtmltopdf wicked-pdf


【解决方案1】:

我也遇到了同样的问题。它只发生在 Chrome 中,不会发生在 Firefox 或 IE 中。

看起来像 Chrome 中的一个错误 - Chrome sends two requests when downloading a PDF (and cancels one of them)

看起来它将在 Chrome 的 v54 中修复。

【讨论】:

    猜你喜欢
    • 2023-04-04
    • 1970-01-01
    • 1970-01-01
    • 2013-07-06
    • 2016-02-20
    • 2021-09-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多