jmckible / princely forked from mbleigh/princely

A simple Rails wrapper for the PrinceXML PDF generation library.

This URL has Read+Write access

jmckible (author)
Tue Jul 08 12:02:57 -0700 2008
commit  42b018a3dae8666173d4b3d0be11c77cd55f65ef
tree    0aff713f4a4b12b82408866f984019a996608ee7
parent  a45ba85528aeb5aaa6f8bb602965d712e6613f09
name age message
file MIT-LICENSE Mon Dec 17 07:55:59 -0800 2007 Initial import of Princely. git-svn-id: http... [michael]
file README Loading commit data...
file Rakefile
file init.rb
directory lib/
README
Princely
========

Princely is a simple wrapper for the Prince XML PDF generation library 
(http://www.princexml.com). It is almost entirely based on the SubImage 
Prince library found on this blog post:

http://sublog.subimage.com/articles/2007/05/29/html-css-to-pdf-using-ruby-on-rails 

I have taken the helpers and made them a little bit more generalized and 
reusable, and created a render option set for pdf generation. The plugin
will also automatically register the PDF MimeType so that you can use
pdf in controller respond_to blocks.

Example
=======

class Provider::EstimatesController < Provider::BaseController
  def show
    respond_to do |format|
      format.html
      format.pdf do
        render :pdf => "file_name", 
               :template => "controller/action.pdf.erb", 
               :stylesheets => ["application","prince"]
               :layout => "pdf"
      end
    end
  end
  
  def pdf
    make_and_send_pdf("file_name")
  end
end

Render Defaults
===============

The defaults for the render options are as follows:

layout:      false
template:    the template for the current controller/action
stylesheets: none

Resources
=========

Trac: http://trac.intridea.com/trac/public/

Copyright (c) 2007 Michael Bleigh and Intridea, Inc., released under the MIT license