uninitialized constant RFPDF::View::TCPDF

59 views
Skip to first unread message

Peter Boling

unread,
Oct 3, 2007, 10:11:11 PM10/3/07
to Ruby on Rails: RFPDF
In response to, as it will not let me continue the thread (too old?):
http://groups.google.com/group/rfpdf/browse_thread/thread/467c32fda86c93f5

Chris,

> > Please help. What could I have done wrong? Thanks

I think you are having the same problem that I am currently having,
since my symptom is the same as yours, a non-readable PDF is created.
If you look in your log/development.log file, I bet you will see that
the error was:
ActionView::TemplateError (uninitialized constant RFPDF::View::TCPDF)
in app/views/pdf_letter/sample.rfpdf:

The RFPDF install instructions say nothing about installing TCPDF, so
I am as confused as you are. So I am headed back to Google.

Ed, are we missing something?

Thanks,
Peter

Peter Boling

unread,
Oct 3, 2007, 10:40:45 PM10/3/07
to Ruby on Rails: RFPDF
> ActionView::TemplateError (uninitialized constant RFPDF::View::TCPDF)
> in app/views/pdf_letter/sample.rfpdf:

Discovering more:

I used this line to install the first time:
ruby script/plugin install http://rfpdf.googlecode.com/svn/trunk

I got that line from here:
http://dry.4thebusiness.com/info/rfpdf

But this page:
http://dry.4thebusiness.com/companies/list

Has the install link like this:
RFPDF plugin - https://rfpdf.googlecode.com/svn/trunk

So when I used the latter it installed a VERY different plugin. It
included many fonts, and TCPDF as well!

So I tried using the same sample code I got here:
http://dry.4thebusiness.com/info/rfpdf_source_code

Restarted mongrel, and this time got a new error:

ActionView::TemplateError (TCPDF error: Could not find font
freeserif.rb.) in app/views/pdf_letter/sample.rfpdf:

So apparently it is calling for some fonts that are missing...

Anyone have any ideas?

Peter

Peter Boling

unread,
Oct 3, 2007, 10:59:20 PM10/3/07
to Ruby on Rails: RFPDF
I figured it out!

> ActionView::TemplateError (TCPDF error: Could not find font
> freeserif.rb.) in app/views/pdf_letter/sample.rfpdf:

I went here:
http://code.google.com/p/rfpdf/downloads/list

I downloaded the missing font. Unzipped it, and placed the files into
the vendor/plugins/rfpdf/lib/fonts directory.

Now I can create PDFs! Joy!

So the lesson here is that the demo code:
http://dry.4thebusiness.com/info/rfpdf_source_code

doesn't work with the version of RFPDF it says to install here:
http://dry.4thebusiness.com/info/rfpdf

You need to install it like this:
1. ruby script/plugin install https://rfpdf.googlecode.com/svn/trunk
2. change the directory's name from trunk to rfpdf.
3. install the missing fonts as I did above.

Hope this helps someone!

Peter

Reply all
Reply to author
Forward
0 new messages