hi I am not getting the css in my pdf i wanna use same css for my pdf also rather going for new css for pdf. how can I use same css which I use in my views. I am using wkhtmltopdf for pdf generation and one more thing is how get page page brake using wkhtmltopdf. Cheers, Kp -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/WSMbiU1XJTsJ. For more options, visit https://groups.google.com/groups/opt_out.
keerthi priya wrote in post #1098932:> hi I am not getting the css in my pdf i wanna use same css for my pdf > also > rather going for new css for pdf. how can I use same css which I use in > my > views. I am using wkhtmltopdf for pdf generation and one more thing is > how > get page page brake using wkhtmltopdf. > > > > > Cheers, > KpStart here https://github.com/mileszs/wicked_pdf -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
I believe wkhtmltopdf will pick up links to stylesheets in your HTML, however, they need to be absolute paths, not relative. You could hack it and pull your HTML, then your CSS, and embed the CSS directly into the head of the HTML. This is probably not the best practice though. On Monday, February 25, 2013 11:28:16 AM UTC-6, Ruby-Forum.com User wrote:> > keerthi priya wrote in post #1098932: > > hi I am not getting the css in my pdf i wanna use same css for my pdf > > also > > rather going for new css for pdf. how can I use same css which I use in > > my > > views. I am using wkhtmltopdf for pdf generation and one more thing is > > how > > get page page brake using wkhtmltopdf. > > > > > > > > > > Cheers, > > Kp > > Start here > > https://github.com/mileszs/wicked_pdf > > -- > Posted via http://www.ruby-forum.com/. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/rTnWF1qdPkkJ. For more options, visit https://groups.google.com/groups/opt_out.
I believe wkhtmltopdf will pick up links to stylesheets in your HTML, however, they need to be absolute paths, not relative. You could hack it and pull your HTML, then your CSS, and embed the CSS directly into the head of the HTML. This is probably not the best practice though. Also, to get a page-break, use the CSS rule page-break-before or page-break-after and make sure you are running a build of wkhtmltopdf that is built against the patched QT. On Monday, February 25, 2013 4:29:30 AM UTC-6, keerthi priya wrote:> > hi I am not getting the css in my pdf i wanna use same css for my pdf also > rather going for new css for pdf. how can I use same css which I use in my > views. I am using wkhtmltopdf for pdf generation and one more thing is how > get page page brake using wkhtmltopdf. > > > > > Cheers, > Kp >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/OAr5pB00n0gJ. For more options, visit https://groups.google.com/groups/opt_out.