I am looking at the following blog posting where someone is using jruby
and iText to create a pdf file and then sending it to the browser :
http://codersifu.blogspot.com/2007/06/howto-generate-pdf-files-in-ruby-on.html
I am using only ruby / on rails.
I would like to do precisely this in ROR and I can get to the second
last line :
document.close <<<--- I can get this document and the m
bytearraystream
send_data String.from_java_bytes(m.toByteArray),
:type=> "application/pdf",
:dispostion=>"inline"
but I dont know how to send_data to the browser with the document and
byetarraystream available.
--
is there an equivalent to String.from_java_bytes in ruby?
--
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
I think I may have figured this out. to pass data to the send_data method you just need to send it the .toByteArray() output and no need to do a String.from_java_bytes!! So I can bypass the from_java_bytes in my case... Ather Shiraz wrote:> I am looking at the following blog posting where someone is using jruby > and iText to create a pdf file and then sending it to the browser : > http://codersifu.blogspot.com/2007/06/howto-generate-pdf-files-in-ruby-on.html > > I am using only ruby / on rails. > > I would like to do precisely this in ROR and I can get to the second > last line : > > document.close <<<--- I can get this document and the m > bytearraystream > send_data String.from_java_bytes(m.toByteArray), > :type=> "application/pdf", :dispostion=>"inline" > > but I dont know how to send_data to the browser with the document and > byetarraystream available. > -- > > is there an equivalent to String.from_java_bytes in ruby?-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---