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')
The above code generates a PDF file without specifying a layout. How to create a PDF file using layout.
layouts/test_layout -> test.css, test.js
My test_layout contains some JavaScript and CSS files.
Please suggest me, I want to print the form in PDF format with the specified location.
source share