2
votes

I am successfully loading CSS files in my PDF file using wicked_pdf gem helpers:

<%= wicked_pdf_stylesheet_link_tag "pdf" %>

This works great in development, however when i deploy in production the pdf CSS file is not correctly imported. Also note that the file is "pdf.scss.erb" and not just "pdf.css".

I am not sure how to fix this problem. Looking at the server logs, i do not see any missed file warnings.

2
Were you ever able to figure this one out? I also ran into this issue :( - jdgray
no @jdgray, what i did was to use the helper in development, which generates the embedded CSS, and then i had to copy paste it into the html file so in production is there too - pastullo
You should use the latest gem version, we also updated slightly the documentation to make it more easy to understand how to use in production! - pastullo

2 Answers

0
votes

I myself solved the problem by duplicating the styles right onto the layout page.

However at this github thread people are advising to do several things:

Include the files in your precompile list in config/initializers/assets.rb as described in the Asset pipeline usage section of the README.

Using stylesheet_link_tag wicked_pdf_asset_base64('pdf')

-1
votes

wkthmltopdf not bundling with dependency library to wkthmltopdf can install the gem after installed gem run bundle install

gem "wkhtmltopdf-binary"