开发者

Ruby on Rails Export CSV data to PDF

I have implemented CSV export, and now I am trying to export data to PDF.

How can one export the 开发者_StackOverflow社区CSV data from the CSV generated file to PDF.

Thanks.


You can use prawn https://github.com/sandal/prawn to generate pdfs in ruby with some code like:

require 'prawn'
pdf = Prawn::Document.new
pdf.text(my_csv_data)
pdf.render_file('csv.pdf')

There is also a tutorial here: http://railstips.org/blog/archives/2008/10/13/how-to-generate-pdfs-in-rails-with-prawn/


You can use PDFKit Try these link s:

http://rubygems.org/gems/pdfkit

https://github.com/grosser/PDFKit/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜