Sha256: 6f4148495390df654f2e10b827c918a47917ed9806f253fe3159923c1b3cc577

Contents?: true

Size: 1.13 KB

Versions: 1

Compression:

Stored size: 1.13 KB

Contents

# PrinceXML Ruby interface.
# http://www.princexml.com
#
# Original code by Seth @ Subimage LLC 
# - http://subimage.com/blog/2007/05/29/html-css-to-pdf-using-ruby-on-rails/
#
#
# USAGE
# -----------------------------------------------------------------------------
#   princely = Princely.new
#   html_string = render_to_string(:template => 'some_document')
#   send_data(
#     princely.pdf_from_string(html_string),
#     :filename => 'some_document.pdf'
#     :type => 'application/pdf'
#   )
#
require 'logger'
require 'pathname'
require 'princely/rails' if defined?(Rails)

module Princely
  autoload :StdoutLogger, 'princely/stdout_logger'
  autoload :AssetSupport, 'princely/asset_support'
  autoload :Pdf,          'princely/pdf'
  autoload :Logging,      'princely/logging'
  autoload :Executable,   'princely/executable'

  class << self
    def executable
      @custom_executable || Princely::Executable.new
    end

    def executable=(custom_executable)
      @custom_executable = custom_executable
    end

    def root
      Pathname.new(File.expand_path('../', __FILE__))
    end

    def ruby_platform
      RUBY_PLATFORM
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
princely-2.1.0 lib/princely.rb