An open API service indexing awesome lists of open source software.

https://github.com/mudge/prawn

A minimal Rails 2.3 plugin to provide a template handler for the Prawn PDF library.
https://github.com/mudge/prawn

Last synced: 14 days ago
JSON representation

A minimal Rails 2.3 plugin to provide a template handler for the Prawn PDF library.

Awesome Lists containing this project

README

          

Prawn
=====

A minimal Rails 2.3+ plugin to render `.pdf.prawn` views in Rails using the
Prawn PDF generation library.

Usage
=======

Simply create views ending in `.pdf.prawn` and use the `pdf` variable like so:

pdf.text "Some bold text"
pdf.table [ [1, 2, 3] ]

Then in your controller you can use the standard `respond_to` semantics:

def show
@article = Article.find(params[:id])
respond_to do |format|
format.html # app/views/articles/show.html.erb
format.pdf # app/views/articles/show.pdf.prawn
end
end

Copyright (c) 2009 Paul Mucur, released under the MIT license