|
RailsPluginActiveFPDF
Introduction Rails Plugin: ActiveFPDFThis rails plugin ActiveFPDF will allow very easy generation of i18n PDF documents (Chinese, Japanese, Korean, Central Europe, Cyrillic, Western Europe, Greek, Turkish, Hebrew, Baltic, Vietnamese and Thai Language) through the use of template file ".rfpdf" views for rails/pdf and optinal layout file ".rb" for pdf, and rely on the cool library Ruby FPDF: http://zeropluszero.com/software/fpdf/. This Plugin includes the library and is for Rails 2.0.2 and Rails 2.1. Install the pluginruby script/plugin install http://cnruby.googlecode.com/svn/trunk/rails-plugins/active_fpdf/vendor/plugins/active_fpdf/ rake active_fpdf:init Prerequisite
Mime::Type.register "application/pdf", :pdf or edit the config/initializers/mime_types.rb for Rails 2.0.2 or for Rails 2.1 Mime::Type.register "application/pdf", :pdf
Developing the rails code with the plugin
format.pdf { render :layout=>false, :template => "{View Name}/pdfs/index" } # index.rfpdf
app/views/{View Name}/pdfs/show.rfpdf
Browsing the results
Demo download and use
Example for more complex development
http://cnruby.googlecode.com/svn/trunk/rails-plugins/active_fpdf/app/controllers/pages_controlller.txt http://cnruby.googlecode.com/svn/trunk/rails-plugins/active_fpdf/app/views/pages/pdfs/show-03.rfpdf require 'pdf_layout_03'
http://cnruby.googlecode.com/svn/trunk/rails-plugins/active_fpdf/app/helpers/pdf_layout_03.rb Error possibility for developing rails codes
Express command for rails example
Known problems
Thnaks |
Sign in to add a comment