This is a plugin which I have developed internally with Iformis. I realised it would be nice to share yet another pdf plugin with the rails community. This is designed to render pdfs with layouts. This is especially useful when working on projects where the pdf has to conform to a set design and where the data is presented in a generate report style. Banks often operate their tools in this manner.
Simple PDF reporting rails plugin designed to render layout based pdfs. Built on top of Ruport which is in turn built on top of pdf-writer.
Requires Ruport
Step 1: Install Ruport
Step 2: Install the plugin (from RAILS_ROOT)
Step 3: Create a class extending Rupdf::Base
Note: The only methods calls required are define_header, define_body and define_footer
The other methods are helper methods. Remember that html doesnt work in the body.
Step 4: Tie it into a controller and pass the variables at runtime.
The send_pdf function sends the rendered pdf to the browser.
If you need to perform more complicated pdf rendering operation
please refer to the API Documentation for pdf-writer. The API docs for
ruport will also be useful if you are involved in presenting tabular
data from activerecord.
Example programming code along with how to call it is supplied in the
examples directory. I suggest you use these as a base for pdf generation code you write.
This has been tested with both Rails 1.2 and Rails 2.01. Thanks for listening.