开发者

PDFKit gem can not hide link - Rails 3

开发者 https://www.devze.com 2023-04-12 18:31 出处:网络
Hello people I was following this tutorial to generate a \"pdf\" file from a view in my rails app. Everything was ok, until I tried to hide the \"link to download\". Everytime I generate the PDF fi

Hello people

I was following this tutorial to generate a "pdf" file from a view in my rails app. Everything was ok, until I tried to hide the "link to download". Everytime I generate the PDF file, the link is still shown. I think that the "@media print" style in the css file is not working.

Is there another way to hide the link in the generated pdf开发者_如何学JAVA file?

Thanks for the help


It is answered here http://railscasts.com/episodes/220-pdfkit. Check section application.css

You need to give an id for the "link to download" then in the CSS file hide the element using display: none. In the above example the id name is pdf_link and css properties are defined like this -

 #pdf_link{ display: none; }

That should work.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号