Wicked PDF - Wait for AJAX request to finish

2019-08-01 08:44发布

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条回答
叛逆
2楼-- · 2019-08-01 09:20

This should work:

render :pdf => 'out.pdf',
       :javascript_delay => 5000
查看更多
登录 后发表回答