资源说明:A very easy way to generate pdf's in a Rails application.
Lleïr Borràs i MetjeThis is a plugin that helps you generating pdf files. Php is needed to run it. This plugin uses http://html2pdf.spipu.net/ I will put some more info, but here is an example. ##config/environment.rb require 'render_as_pdf' ##CONTROLLER class ReportsController < ApplicationController def show @report = Report.find(params[:id]) respond_to do |format| format.pdf{ pdf_data=render_as_pdf(:template => "/cens/show.html.erb" , :layout => false) send_data(pdf_data, :type => "application/pdf", :filename => "some_name.pdf") } end end end ##VIEW Here your header<--> Here your footer<--> Here your data<-->
本源码包内暂不包含可直接显示的源代码文件,请下载源码包。