How to export a dataset to PDF file. I wrote the following code for
exporting a dataset to pdf file. I want the column name and column
seperators(leave space for each column),Please find the attatched file,
i want to seperate the values as explaned.How the same will be applied
in NetBeans IDE.
def prints
@records = Company.find(:all)
_pdf = PDF::Writer.new
_pdf.select_font "Times-Roman"
@records.each do |company|
_pdf.text company.name + company.com_address1 +
company.com_address2,:border=>'1'
end
send_data _pdf.render, :filename => "hello.pdf",
:type => "application/pdf"
How to create simple pdf file using prawn library i followed this url
but can create the simple file this format
def show
Prawn::Document.generate “hello-ttf.pdf” do
fill_color “0000ff”
text “Hello World”, :at => [200,720], :size => 32
text "This is chalkboard wrapping " * 20
end
end
Regards
R.Devi
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.