Question

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?

Was it helpful?

Solution

This should work:

render :pdf => 'out.pdf',
       :javascript_delay => 5000
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top