Thanks guys for the help. Unfortunately, I am sort of stuck with rails
1.2.6, due to compatibility issues with other plugins I'm using. But
the way I see it is I should still be able to get this to work...
people did before so surely they can now.
The first step was as Ed Moss said take a look at the older version,
which I did. I installed the original commit version on my app, and
now I can start the server. Then I was only getting missing font
errors.. which was easily fixed. I feel like I'm closer than I've ever
been before to just getting that sample PDF to create.
I moved some things around and now I'm down to this error:
====================================
TypeError in Shorts#print_pdf
Showing app/views/shorts/_print_list.rhtml where line #8 raised:
can't convert nil into String
Extracted source (around line #8):
5: text_options = {:font => "freeserif"}
6: @pdf.draw_text(15, 10, "text", {:font_size => 12, :font =>
"freeserif"})
7: %>
8: <%=@pdf.Output()%>
====================================
Below I have provided the session dump, if it helps. My whole thing is
I just don't understand why I can't get things to work like the DRY
Scaffold example. It seems to me I'm having to go about it a whole
different way. They used a controller called report and an associated
helper and view. When I take that approach, the plugin keeps nagging
at me saying I don't have template of type rhtml or xml called
_print_list. First off, why must it be _print_list? All the examples I
see online don't have a _print_list file...
So anyways I figured I'd just follow through with what it said, and I
made the _print_list.rhtml file with the very simple example rhtml
code provided in the README for the plugin, and I'm down to the error
I mentioned above.
Do you guys think the errors I'm getting might be linked to
incompatible version of ActiveScaffoldTools? I'm using ActiveScaffold
and hence ASTools to get the "Print PDF" button above my scaffold
view, much like the DRY Scaffold example. I got my ASTools off of
GitHub.
Here's the session dump:
========================================================
C:/Users/Fiend/Eclipse/MyApp/vendor/plugins/rfpdf/lib/tcpdf.rb:2295:in
`open'
C:/Users/Fiend/Eclipse/MyApp/vendor/plugins/rfpdf/lib/tcpdf.rb:2295:in
`putfonts'
C:/Users/Fiend/Eclipse/MyApp/vendor/plugins/rfpdf/lib/tcpdf.rb:2290:in
`each'
C:/Users/Fiend/Eclipse/MyApp/vendor/plugins/rfpdf/lib/tcpdf.rb:2290:in
`putfonts'
C:/Users/Fiend/Eclipse/MyApp/vendor/plugins/rfpdf/lib/tcpdf.rb:2514:in
`putresources'
C:/Users/Fiend/Eclipse/MyApp/vendor/plugins/rfpdf/lib/tcpdf.rb:2599:in
`enddoc'
C:/Users/Fiend/Eclipse/MyApp/vendor/plugins/rfpdf/lib/tcpdf.rb:734:in
`Close'
C:/Users/Fiend/Eclipse/MyApp/vendor/plugins/rfpdf/lib/tcpdf.rb:2083:in
`Output'
C:/Users/Fiend/Eclipse/MyApp/app/views/shorts/_print_list.rhtml:8:in
`_run_rhtml_47app47views47shorts47_print_list46rhtml'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_view/
base.rb:325:in `send'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_view/
base.rb:325:in `compile_and_render_template'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_view/
base.rb:301:in `render_template'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_view/
base.rb:260:in `render_file'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_view/
base.rb:275:in `render_without_active_scaffold'
C:/Users/Fiend/Eclipse/MyApp/vendor/plugins/active_scaffold/lib/
extensions/action_view_rendering.rb:60:in `render'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_view/
partials.rb:59:in `render_partial_without_active_scaffold'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
benchmarking.rb:26:in `benchmark'
c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
c:/ruby/lib/ruby/1.8/benchmark.rb:307:in `realtime'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
benchmarking.rb:26:in `benchmark'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_view/
partials.rb:58:in `render_partial_without_active_scaffold'
C:/Users/Fiend/Eclipse/MyApp/vendor/plugins/active_scaffold/lib/
extensions/action_view_rendering.rb:70:in `render_partial'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
base.rb:856:in `render_partial'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
base.rb:768:in `render_with_no_layout'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
layout.rb:256:in `render_without_benchmark'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
benchmarking.rb:50:in `render_without_active_scaffold'
c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
benchmarking.rb:50:in `render_without_active_scaffold'
C:/Users/Fiend/Eclipse/MyApp/vendor/plugins/active_scaffold/lib/
extensions/action_controller_rendering.rb:13:in `render'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
base.rb:792:in `render_to_string'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/
deprecation.rb:44:in `silence'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
base.rb:792:in `render_to_string'
C:/Users/Fiend/Eclipse/MyApp/vendor/plugins/activescaffoldtools/lib/
actions/print_pdf.rb:14:in `print_pdf'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
mime_responds.rb:135:in `call'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
mime_responds.rb:135:in `custom'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
mime_responds.rb:167:in `call'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
mime_responds.rb:167:in `respond'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
mime_responds.rb:161:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
mime_responds.rb:161:in `respond'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
mime_responds.rb:105:in `respond_to'
C:/Users/Fiend/Eclipse/MyApp/vendor/plugins/activescaffoldtools/lib/
actions/print_pdf.rb:12:in `print_pdf'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
base.rb:1101:in `send'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
base.rb:1101:in `perform_action_without_filters'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
filters.rb:696:in `call_filters'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
filters.rb:688:in `perform_action_without_benchmark'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
benchmarking.rb:66:in `perform_action_without_rescue'
c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
benchmarking.rb:66:in `perform_action_without_rescue'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
rescue.rb:83:in `perform_action'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
base.rb:435:in `send'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
base.rb:435:in `process_without_filters'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
filters.rb:684:in `process_without_session_management_support'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
session_management.rb:114:in `process'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/
base.rb:334:in `process'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/dispatcher.rb:41:in
`dispatch'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/webrick_server.rb:
113:in `handle_dispatch'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/webrick_server.rb:79:in
`service'
c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/webrick_server.rb:63:in
`dispatch'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/commands/servers/
webrick.rb:59
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/
dependencies.rb:495:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/
dependencies.rb:342:in `new_constants_in'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/
dependencies.rb:495:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/commands/server.rb:39
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/
dependencies.rb:495:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/
dependencies.rb:342:in `new_constants_in'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/
dependencies.rb:495:in `require'
script/server:3
-e:4:in `load'
-e:4
==========================================================
Thanks so much for all the help. I feel certain this will be of great
assistance to other struggling developers out there trying to simulate
the DRY Scaffold example.