Hi All,

I want to generate pdf with css. I am using princely plugin.

This is code which I written

 def pdf
   prince = Prince.new()
   html_string = render_to_string(:template =>
'/users/paid_invoice.pdf.erb')
   send_data(
     prince.pdf_from_string(html_string),
     :filename => 'some_document.pdf',
     :type => 'application/pdf'
   )
end

But I am getting error of nil.size


You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.size

RAILS_ROOT: /var/www/sortapp
Application Trace | Framework Trace | Full Trace

/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/streaming.rb:123:in
`send_data'
app/controllers/users_controller.rb:135:in `pdf'

I also used make_and_send_pdf  function but got the same error.
I thought I am getting error in render_to_string function.

Can anyone tell me how can I solve this issues?

Thanks in advance
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to