Giter Club home page Giter Club logo

princely's Introduction

Princely

Princely is a simple wrapper for the Prince XML PDF generation library (www.princexml.com). The plugin will also automatically registers the PDF MimeType so that you can use pdf as a format in controller respond_to blocks.

Example

class Provider::EstimatesController < Provider::BaseController
  # You can render PDF templates simply by
  # using the :pdf option on render templates.
  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

  # Alternatively, you can use make_and_send_pdf to
  # render out a PDF for the action without a
  # respond_to block.
  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

Contributors

  • Gemification and more: Nic Williams

Resources

  • Copyright © 2007-2009 Michael Bleigh and Intridea, Inc., released under the MIT license.

princely's People

Contributors

drnic avatar hardbap avatar cpjolicoeur avatar jmckible avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.