Wicked PDF - Wait for AJAX request to finish

寵の児 提交于 2020-01-05 07:40:17

问题


I'm trying to generate a PDF using WickedPDF and all of my static HTML/CSS is loading. I have a few elements on the page that are populated using AJAX requests, but they are not showing up in the PDF.

I know :redirect_delay can be passed as a parameter, but this does not help in the case of waiting for my AJAX calls to finish. Since I didn't see any mention of Wicked PDF and pages generated from AJAX calls, I figured I'd ask:

Is what I'm trying to do possible with Wicked PDF (or other projects), or do I have to pass everything to the front end before generating a PDF?


回答1:


This should work:

render :pdf => 'out.pdf',
       :javascript_delay => 5000


来源:https://stackoverflow.com/questions/13372946/wicked-pdf-wait-for-ajax-request-to-finish

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!