George Entenman
2005-Jul-27 00:41 UTC
Can Rails produce (and possibly help design) online PDF reports?
A friend of mine and I want very much to use Rails to create reports for a voter database for our local Democratic party. I won''t tell you how we''re doing them now ;-) If we could be assured that we could generate nice-looking reports that could be output in PDF and downloaded via a browser, then I think we could get buy-in for a Rails project. Wouldn''t that be cool? The database is in MySQL. It''s simple enough to rename tables, etc., to conform to the Rails naming conventions. We need: 1. The ability to create PDF output from Rails. 2. Some way to design/specify reports so that they will look decent. We don''t need the ability for people to design their reports with a browser (but we wouldn''t turn that down!). I can imagine a number of ways that this might work (e.g., tool produces XML, which Rails then processes), but I''d rather find out if there are other suggestions. I swear I''ve searched the rails mailing list archive and the web for answers to this but found very little. Anyone got any suggestions? Or do we do it in Java? Thanks, George Entenman
James Earl
2005-Jul-27 01:04 UTC
Re: Can Rails produce (and possibly help design) online PDF reports?
On 7/26/05, George Entenman <zabouti-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 1. The ability to create PDF output from Rails. > > 2. Some way to design/specify reports so that they will look decent. > We don''t need the ability for people to design their reports with a > browser (but we wouldn''t turn that down!). I can imagine a number of > ways that this might work (e.g., tool produces XML, which Rails then > processes), but I''d rather find out if there are other suggestions. > > I swear I''ve searched the rails mailing list archive and the web for > answers to this but found very little. > > Anyone got any suggestions? Or do we do it in Java?Creating PDF output isn''t really specific to Rails. You can use FOP to convert xsl-fo documents to PDFs. There''s also xmlroff, but I believe it may be missing some features that FOP has. If you have simple requirements, you can convert HTML to PDFs using htmldoc. There''s other document formats that can also be converted to PDFs, such as Latex.
Matt Jankowski
2005-Jul-27 01:13 UTC
Re: Can Rails produce (and possibly help design) online PDF reports?
I have not personally used this tool, but have heard it works for simple PDF creation... http://ruby-pdf.rubyforge.org/pdf-writer/manual/index.html It''s available as a gem as well. -Matt James Earl wrote:> On 7/26/05, George Entenman <zabouti-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >>1. The ability to create PDF output from Rails. >> >>2. Some way to design/specify reports so that they will look decent. >>We don''t need the ability for people to design their reports with a >>browser (but we wouldn''t turn that down!). I can imagine a number of >>ways that this might work (e.g., tool produces XML, which Rails then >>processes), but I''d rather find out if there are other suggestions. >> >>I swear I''ve searched the rails mailing list archive and the web for >>answers to this but found very little. >> >>Anyone got any suggestions? Or do we do it in Java? > > > Creating PDF output isn''t really specific to Rails. You can use FOP > to convert xsl-fo documents to PDFs. There''s also xmlroff, but I > believe it may be missing some features that FOP has. > > If you have simple requirements, you can convert HTML to PDFs using htmldoc. > > There''s other document formats that can also be converted to PDFs, > such as Latex. > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
James Earl
2005-Jul-27 01:59 UTC
Re: Can Rails produce (and possibly help design) online PDF reports?
On 7/26/05, Matt Jankowski <mjankowski-3V1LzDqIiU+4+7hldlPAjkEOCMrvLtNR@public.gmane.org> wrote:> I have not personally used this tool, but have heard it works for simple > PDF creation... > > http://ruby-pdf.rubyforge.org/pdf-writer/manual/index.html > > It''s available as a gem as well.Excellent link! Thanks
James Burns-Howell
2005-Jul-27 14:17 UTC
Re: Can Rails produce (and possibly help design) online PDF reports?
On 27 Jul 2005, at 01:41, George Entenman wrote:> I swear I''ve searched the rails mailing list archive and the web for > answers to this but found very little. > > Anyone got any suggestions? Or do we do it in Java?Me too, so for the future reference of others, this is how we ended up doing it: 1. Generate PDFs in the layout package of your choice (Illustrator/ Word). Makes for much easier template generation than building the PDF in code. 2. Convert to PDF forms using Acrobat, adding text fields, checkboxes, etc. 3. Generate a temporary FDF file containing the data for the report (couldn''t find a Ruby lib to do this, but FDF is just structured plain-text and hacking something together was easy) 4. Push the lot through the fantastic pdftk (http://www.pdfhacks.com/ pdftk/), flattening the form as you go which injects the data into the form fields and makes them un-editable. We also encrypt and compress the output PDF at this stage to prevent modification from within PDF editors. Hope it helps someone, J
Robby Russell
2005-Jul-27 14:42 UTC
Re: Can Rails produce (and possibly help design) online PDF reports?
On Tue, 2005-07-26 at 20:41 -0400, George Entenman wrote:> A friend of mine and I want very much to use Rails to create reports > for a voter database for our local Democratic party. I won''t tell you > how we''re doing them now ;-) > > If we could be assured that we could generate nice-looking reports > that could be output in PDF and downloaded via a browser, then I think > we could get buy-in for a Rails project. Wouldn''t that be cool? > > The database is in MySQL. It''s simple enough to rename tables, etc., > to conform to the Rails naming conventions. > > We need: > > 1. The ability to create PDF output from Rails. >Generating PDFs is quite easy: http://www.robbyonrails.com/articles/2005/06/04/ruby-fpdf-on-ruby-on-rails> 2. Some way to design/specify reports so that they will look decent. > We don''t need the ability for people to design their reports with a > browser (but we wouldn''t turn that down!). I can imagine a number of > ways that this might work (e.g., tool produces XML, which Rails then > processes), but I''d rather find out if there are other suggestions. > > I swear I''ve searched the rails mailing list archive and the web for > answers to this but found very little. > > Anyone got any suggestions? Or do we do it in Java? > > Thanks, > George Entenman > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-- /****************************************************** * Robby Russell, Owner.Developer.Geek * PLANET ARGON, Open Source Solutions & Web Hosting * Portland, Oregon | p: 503.351.4730 | f: 815.642.4068 * www.planetargon.com | www.robbyonrails.com *******************************************************/