anyone uses a PDFKit to generate pdfs in rails? how i transform my PDFKit.new("<p>Hello Brazil</p>") into a pdf file? i`d try but i dont find anything about documentation how use a methods for generate pdfs, any help? thanks a lot Leo Caminha -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
PDFKit.new("<p>Hello Brazil</p>").to_pdf On Sun, Jun 26, 2011 at 12:07 AM, leoncio caminha < leoncio.sobreira-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> anyone uses a PDFKit to generate pdfs in rails? how i transform my > PDFKit.new("<p>Hello Brazil</p>") into a pdf file? i`d try but i dont > find anything about documentation how use a methods for generate pdfs, > any help? thanks a lot > > Leo Caminha > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sun, Jun 26, 2011 at 2:48 AM, Jatin kumar <jatinkumar.nitk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> PDFKit.new("<p>Hello Brazil</p>").to_pdf > > Sorry for interruption.I tried it to .I am using rails 3.0.7.I pasted above > code in action of a button so that click on it can generate pdf.but i didn''t > work. >> Output is: >> > heloPDFKit.new(" > > Hello Brazil > ").to_pdf >thanks amritpalpathakgne.wordpress.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
when i try this <%= button_to "Teste", PDFKit.new("Hello Brazil").to_pdf %> its output me a error ArgumentError (invalid byte sequence in UTF-8): pdfkit (0.5.1) lib/pdfkit/middleware.rb:16:in `call'' <internal:prelude>:10:in `synchronize'' /Users/leocaminha/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'' /Users/leocaminha/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'' /Users/leocaminha/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'' Em 26/06/2011, às 04:05, amritpal pathak escreveu:> > > On Sun, Jun 26, 2011 at 2:48 AM, Jatin kumar <jatinkumar.nitk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > PDFKit.new("<p>Hello Brazil</p>").to_pdf > > Sorry for interruption.I tried it to .I am using rails 3.0.7.I pasted above code in action of a button so that click on it can generate pdf.but i didn''t work. > > Output is: > > > > helo > > PDFKit.new(" > Hello Brazil > > ").to_pdf > > thanks > > amritpalpathakgne.wordpress.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Jatin I found it! in your action on controller put like this pdf = PDFKit.new(html_text) send_data pdf.to_pdf, :filename => "name_of pdf.pdf", :type => :pdf and in your environment, put this Mime::Type.register ''application/pdf'', :pdf # to recognize pdf files into application works from me but, I''m yet on lil problem: i don''t get generate a html header repeating each page of pdf…anyone? Thanks a lot everyone! Hugs! @leocaminha Em 26/06/2011, às 04:05, amritpal pathak escreveu:> > > On Sun, Jun 26, 2011 at 2:48 AM, Jatin kumar <jatinkumar.nitk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > PDFKit.new("<p>Hello Brazil</p>").to_pdf > > Sorry for interruption.I tried it to .I am using rails 3.0.7.I pasted above code in action of a button so that click on it can generate pdf.but i didn''t work. > > Output is: > > > > helo > > PDFKit.new(" > Hello Brazil > > ").to_pdf > > thanks > > amritpalpathakgne.wordpress.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sun, Jun 26, 2011 at 10:29 PM, Leoncio Caminha < leoncio.sobreira-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Jatin I found it! > > in your action on controller put like this > pdf = PDFKit.new(html_text) > send_data pdf.to_pdf, :filename => "name_of pdf.pdf", :type => :pdf > > and in your environment, put this > Mime::Type.register ''application/pdf'', :pdf # to recognize pdf files into > application > > works from me > > What you have found out are the basic steps to get PDFkit to work, and lasttime I checked they were written on the install guide or something of PDFkit. Anyways, its good that you got it working.> but, I''m yet on lil problem: i don''t get generate a html header repeating > each page of pdf…anyone? > > I don''t get what you are asking.Is it like it is generating pdf for each view you open. Its a bug in the latest version of pdfkit, install the previous one, or describe the whole scenario of problems that you are facing.> Thanks a lot everyone! > > Hugs! > > @leocaminha > > Em 26/06/2011, às 04:05, amritpal pathak escreveu: > > > > On Sun, Jun 26, 2011 at 2:48 AM, Jatin kumar <jatinkumar.nitk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: > >> PDFKit.new("<p>Hello Brazil</p>").to_pdf >> >> Sorry for interruption.I tried it to .I am using rails 3.0.7.I pasted >> above code in action of a button so that click on it can generate pdf.but i >> didn''t work. >> > > >> Output is: >> > > > >> >> heloPDFKit.new(" >> >> Hello Brazil >> ").to_pdf >> > > thanks > > amritpalpathakgne.wordpress.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.