Javascript does not seem to work before rendering PDF.
First, make sure it is enabled when rendering a PDF. According to the link , there is an option :disable_javascript => false to render :pdf .
Then all assets should be included with absolute URLs. According to the same link,
You must specify absolute paths to CSS files, images, and javascripts; the best option is to use wicked_pdf_stylesheet_link_tag, wicked_pdf_image_tag and wicked_pdf_javascript_include_tag helpers.
source share