From: Robby Russell Date: 2005-09-24T23:33:30+09:00 Subject: Re: fpdf in ruby On Sat, 2005-09-24 at 23:11 +0900, Nick wrote: > this is the controller > > class ProductController < ApplicationController > scaffold :product > require 'fpdf' > > def pdf > send_data gen_pdf, :filename => "robbyonrails-fpdf-test.pdf", :type => > "application/pdf" > end > > private > def gen_pdf > d = Date.today > pdf=FPDF.new > pdf.AddPage > pdf.SetFont('Arial') > pdf.SetFontSize(10) > > pdf.Cell(0,6, "PLANET ARGON", 0,1,'R') > pdf.Cell(0,6, "2802 NE 57th Ave",0,1,'R') > pdf.Cell(0,6, "Portland, OR 97213",0,0,'R') > > pdf.Ln > pdf.Ln > pdf.Write(5, "Jane Doe > 123 ABC Street > Gilroy, CA 95020 > > #{d.month}/#{d.mday}/#{d.year} > > Dear Jane Doe, > > I just wanted to say... > > Epsum factorial non deposit quid pro quo hic escorol. Olypian quarrels et > gorilla congolium sic ad nauseum. Souvlaki ignitus carborundum e pluribus > unum. Defacto lingo est igpay atinlay. Marquee selectus non provisio > incongruous feline nolo contendre. Gratuitous octopus niacin, sodium > glutimate. Quote meon an estimate et non interruptus stadium. Sic tempus > fugit esperanto hiccup estrogen. Glorious > > Cheers, > > Robby Russell > ") > pdf.Ln > pdf.Cell(0,6, "PLANET ARGON", 0,1,'L',0,'http://www.planetargon.com/') > pdf.Output > > end > > end > > ------------------- > sometimes it is all wierd letters i get, or i want to download it, but i > cant from the server (127.0.0.1) > and i have put the dir 'fpdf' in 'lib' > > any help It's been a while since I wrote that blog entry. If I recall, you need to download the Ruby FPDF library from here: http://brian.imxcc.com/fpdf/ I don't see this link in my blog post, I apologize. I have updated it with the link: http://rubyurl.com/GU8 Download that and put it into your lib/ directory. Robby -- /****************************************************** * Robby Russell, Owner.Developer.Geek * PLANET ARGON, Open Source Solutions & Web Hosting * Portland, Oregon | p: 503.351.4730 | f: 815.642.4068 * www.planetargon.com | www.robbyonrails.com *******************************************************/