Created
October 29, 2012 17:11
-
-
Save mgswolf/3974951 to your computer and use it in GitHub Desktop.
example use of pdf-kit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# your controller | |
def export_pdf | |
html = render :layout => 'print' #or false | |
kit = PDFKit.new(html) | |
kit.stylesheets << "#{Rails.root/app/assets/stylesheets/print.css" | |
send_data(kit.to_pdf, :filename => "your_pdf_name.pdf", :type => 'application/pdf') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment