邪恶的PDF-等待AJAX请求完成 [英] Wicked PDF - Wait for AJAX request to finish
问题描述
我正在尝试使用WickedPDF生成PDF,并且我的所有静态HTML/CSS都正在加载.我在页面上有一些使用AJAX请求填充的元素,但是它们没有显示在PDF中.
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.
我知道:redirect_delay可以作为参数传递,但是在等待我的AJAX调用完成的情况下这无济于事.由于我没有看到任何有关Wicked PDF和AJAX调用生成的页面的信息,所以我想问一下:
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:
我要使用Wicked PDF(或其他项目)来做些什么吗?还是必须在生成PDF之前将所有内容传递给前端?
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?
推荐答案
这应该有效:
render :pdf => 'out.pdf',
:javascript_delay => 5000
这篇关于邪恶的PDF-等待AJAX请求完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!