Hi, I need to export data to a PDF file with proper CSS as displayed in HTML. Could you please tell me what is the best and proper way to do this. Thanks, Nitin Mathur. -- 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 Feb 18, 10:32 am, Nitin Mathur <nitinkumar.mat...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, I need to export data to a PDF file with proper CSS as displayed in > HTML. Could you please tell me what is the best and proper way to do this.http://lmgtfy.com/?q=rails+export+html+to+pdf# There are lots of ways to do this, and deciding which one is right for your app takes a LOT more information than your post provides... --Matt Jones -- 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.
Try prawn gem. Its a good place to start so here http://prawn.majesticseacreature.com/ Hope it helps. On Feb 18, 4:32 pm, Nitin Mathur <nitinkumar.mat...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, I need to export data to a PDF file with proper CSS as displayed in > HTML. Could you please tell me what is the best and proper way to do this. > > Thanks, > Nitin Mathur.-- 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.
If you have a linux server, you can use wkhtmltopdf. I found it non-trivial to set up, though. On Sun, Feb 19, 2012 at 8:02 PM, Mr. Winnymann <nkelem-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Try prawn gem. Its a good place to start so here http://prawn.majesticseacreature.com/ > > Hope it helps. > > On Feb 18, 4:32 pm, Nitin Mathur <nitinkumar.mat...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> Hi, I need to export data to a PDF file with proper CSS as displayed in >> HTML. Could you please tell me what is the best and proper way to do this. >> >> Thanks, >> Nitin Mathur. > > -- > 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.
Nitin Mathur wrote in post #1047547:> Hi, I need to export data to a PDF file with proper CSS as displayed in > HTML. Could you please tell me what is the best and proper way to do > this. > > Thanks, > Nitin Mathur.Go with prawn gem. -- 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-/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.
Hi, Thanks for your replies. First I''ll put more details of my development environment and the requirements: I have linux server (FC8). The project was started 4 years back with Ruby 1.8.6 and Rails 1.2.3. It''s very old now but I can''t upgrade to latest version as it has become a big project and upgrading might cause lots of issues. Regarding web server I am using native Mogrel server. I need to export the whole HTML page as it is to the PDF with all the CSS styles present in the page. I prefer the *Prawn gem* way but unfortunately it isn''t supported in the version of Rails used in my project. I have tried *"**wkhtmltopdf"*. I am seeing the issue that the application gets stuck while running the command to generate PDF. I have also tried using "*htmldoc gem"* which works well with static HTML content in *rpdf *file. iterating over array is not working in rpdf. Let me know if it''s possible to use Prawn with Rails 1.2.3 somehow. or, how to resolve issue seen with "wkhtmltopdf" binary execution. Thanks! -- 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.
If you are running wkhtmltopdf in debug mode, you need to run a separate mongrel and point the wkhtmltopdf to that url, otherwise it tries to hit your mongrel instance, which is waiting for wkhtmltopdf to finish running. Cheers Simon On Mon, 20 Feb 2012 18:58:45 +0800, Nitin Mathur <nitinkumar.mathur-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, Thanks for your replies. > > First I''ll put more details of my development environment and the > requirements: > > I have linux server (FC8). The project was started 4 years back with Ruby > 1.8.6 and Rails 1.2.3. It''s very old now but I can''t upgrade to latest > version as it has become a big project and upgrading might cause lots of > issues. > > Regarding web server I am using native Mogrel server. > > I need to export the whole HTML page as it is to the PDF with all the CSS > styles present in the page. I prefer the *Prawn gem* way but > unfortunately > it isn''t supported in the version of Rails used in my project. > > I have tried *"**wkhtmltopdf"*. I am seeing the issue that the > application > gets stuck while running the command to generate PDF. > > I have also tried using "*htmldoc gem"* which works well with static HTML > content in *rpdf *file. iterating over array is not working in rpdf. > > Let me know if it''s possible to use Prawn with Rails 1.2.3 somehow. or, > how > to resolve issue seen with "wkhtmltopdf" binary execution. > > Thanks!-- 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.
Thanks Simon. Let me try this approach. But not looks a satisfactory solution to me :) running two servers of same application. -- 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 Feb 20, 2012, at 5:58 AM, Nitin Mathur wrote:> Hi, Thanks for your replies. > > First I''ll put more details of my development environment and the requirements: > > I have linux server (FC8). The project was started 4 years back with Ruby 1.8.6 and Rails 1.2.3. It''s very old now but I can''t upgrade to latest version as it has become a big project and upgrading might cause lots of issues. > > Regarding web server I am using native Mogrel server. > > I need to export the whole HTML page as it is to the PDF with all the CSS styles present in the page. I prefer the Prawn gem way but unfortunately it isn''t supported in the version of Rails used in my project.Take a look at PrinceXML, as it is designed to take (X)HTML and convert it to PDF. It runs as a separate binary on your server, and it''s extremely powerful. It costs serious money, but there is a free evaluation version you can try. Walter> > I have tried "wkhtmltopdf". I am seeing the issue that the application gets stuck while running the command to generate PDF. > > I have also tried using "htmldoc gem" which works well with static HTML content in rpdf file. iterating over array is not working in rpdf. > > Let me know if it''s possible to use Prawn with Rails 1.2.3 somehow. or, how to resolve issue seen with "wkhtmltopdf" binary execution. > > Thanks! > > -- > 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 only need to do that for development (when you are testing PDF export). Your production system should already be running multiple instances (otherwise only one person can view your site at a time) all on the same url. On Mon, 20 Feb 2012 21:35:33 +0800, Nitin Mathur <nitinkumar.mathur-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thanks Simon. Let me try this approach. But not looks a satisfactory > solution to me :) running two servers of same application.-- 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.