ruby on rails - How to create pdf file with layout applied to it. Using pdfkit gem -


require 'pdfkit' html = render_to_string(:layout => 'layouts/test_layout' , :action => print_form.html.erb") kit = pdfkit.new(html) send_data(kit.to_pdf, :filename => "form.pdf", :type => 'application/pdf') 

above code generates pdf file without layout specified. how create pdf file layout applied.

layouts/test_layout ->   test.css, test.js 

my test_layout contains javascript , css files.

please suggest me, want print form in pdf format specified layout.

without seeing render_to_string method can't tell what's going wrong. here example code generating pdf layout: https://github.com/pdfkit/pdfkit#usage


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -