wicked_pdf does not include styles
Asked Answered
A

1

9

I used <%= wicked_pdf_stylesheet_link_tag "pdf" %> it shows the following output in the html

<link href="/stylesheets/pdf.css?1302860585" media="screen" rel="stylesheet" type="text/css"> <link href="file:///home/likewise-open/NEXTBRIDGE/nazar.hussain/osd/development/atlantis/public/stylesheets/pdf" media="screen" rel="stylesheet" type="text/css">

But when create the pdf it do not have any style. If i copy all css from the file to the header of the page, it includes all styles. What is the issue and how to solve it.

Airborne answered 15/4, 2011 at 10:24 Comment(0)
P
2

I personally haven't had any trouble with this method, but I've seen others that have.

I just pushed some updates to the main project that should resolve this issue for you.

wicked_pdf_stylesheet_link_tag now will inline any css files passed in directly into the markup.

I also updated the Github issue you created.

Paschal answered 15/4, 2011 at 17:42 Comment(1)
I also resolved the issue with inline technique. I used <%= render :file=>path_to_css_file %> in the head tag of the page. So it means your latest commit will also resolve the issue.Airborne

© 2022 - 2024 — McMap. All rights reserved.