Sha256: c0ac34e0c67303c179e4d3697f4600647113cd2ef7c7938a61d107317c4d3629

Contents?: true

Size: 1.42 KB

Versions: 9

Compression:

Stored size: 1.42 KB

Contents

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
=========

* Copyright (c) 2007 Michael Bleigh and Intridea, Inc., released under the MIT license
* Copyright (c) 2007 Seth from Subimage from http://sublog.subimage.com/2007/05/29/html-css-to-pdf-using-ruby-on-rails

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
drnic-princely-1.1.0 README.md
drnic-princely-1.1.1 README.md
drnic-princely-1.1.2 README.md
drnic-princely-1.1.3 README.md
drnic-princely-1.2.0 README.md
drnic-princely-1.2.1 README.md
drnic-princely-1.2.2 README.md
drnic-princely-1.2.3 README.md
drnic-princely-1.2.5 README.md