seven1m / prawn_template_handler

Uber simple template handler for Prawn PDF views in Rails.

This URL has Read+Write access

name age message
file README.markdown Wed Dec 09 08:17:27 -0800 2009 Updated readme, and removed gem specification. [seven1m]
file init.rb Fri Dec 26 09:27:06 -0800 2008 Initial import. [seven1m]
directory lib/ Fri Dec 26 09:27:06 -0800 2008 Initial import. [seven1m]
README.markdown

prawn_template_handler

This is a template handler for Prawn PDF views in Rails. Simpler than Prawnto.

Installation

script/plugin install git://github.com/seven1m/prawn_template_handler.git

Usage

The template registers the pdf mimetype, and the prawn template extension.

In the view file show.pdf.prawn:

pdf.move_down 200
pdf.text 'Hello World'

That's it!

If you need to specify document options, add a @pdf line to your show method, like so:

def show
  @pdf = Prawn::Document.new(:page_layout => :landscape)
end

License

Released into the Public Domain.