The Ruby On Rails Wiki lists a couple of libraries that facilitate PDF generation in Rails. I need to print out address labels (in letter f
Prawn is the way to go. Now with prawn-labels that is really easy to do.
Check out the project's README here:
https://github.com/jordanbyron/prawn-labels#readme
This is a super simple example being used in a Rails controller. Don't forget to add gem 'prawn-labels' to your Gemfile.
names = %w{Jordan Kelly Greg Bob}
labels = Prawn::Labels.render(names, :type => "Avery5160") do |pdf, name|
pdf.text name
end
send_data labels, :filename => "names.pdf", :type => "application/pdf"