# Printing quality documents (invoices, etc..) from rails

**URL:** <https://www.ruby-forum.com/t/printing-quality-documents-invoices-etc-from-rails/98549>\
**Category:** Rails\
**Created:** [January 29, 2006, 9:55pm UTC](https://www.ruby-forum.com/t/printing-quality-documents-invoices-etc-from-rails/98549 "2006-01-29T21:55:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/958977/32.png) [@chris](https://www.ruby-forum.com/u/chris)\
**Post date:** [January 29, 2006, 9:55pm UTC](https://www.ruby-forum.com/t/printing-quality-documents-invoices-etc-from-rails/98549/1 "2006-01-29T21:55:04Z")

</div>

Thanks for the info alex

All i really want to do is easily print quality invoice (+other)  
documents from within Rails. THe info is already in the mysql  
database, so rails has full access.

Is there an easy way to do it?

Thanks,  
Chris

---

<div class="post-metadata">

**Author:** ![chris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/958977/32.png) [@chris](https://www.ruby-forum.com/u/chris)\
**Post date:** [January 29, 2006, 10:12pm UTC](https://www.ruby-forum.com/t/printing-quality-documents-invoices-etc-from-rails/98549/2 "2006-01-29T22:12:04Z")

</div>

I’m just about to cross this bridge myself with an app I’m working on.  
PDF::Writer seems to be a pretty good solution - you can make a PDF  
file look pretty much as good as you want, and PDF::Writer seems to be  
a good compromise between ease of use and capability as far as  
generating PDFs goes.

Check the sample code to see how it works.

Regards

Dave M.

---

<div class="post-metadata">

**Author:** ![chris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/958977/32.png) [@chris](https://www.ruby-forum.com/u/chris)\
**Post date:** [January 30, 2006, 1:02am UTC](https://www.ruby-forum.com/t/printing-quality-documents-invoices-etc-from-rails/98549/3 "2006-01-30T01:02:08Z")

</div>

I’m looking at using JasperReports with rails:

[http://wiki.rubyonrails.org/rails/pages/HowtoIntegrateJasperReports](http://wiki.rubyonrails.org/rails/pages/HowtoIntegrateJasperReports)

Looks interesting.

Has anyone had any experience with JasperReports?

---

<div class="post-metadata">

**Author:** ![chris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/958977/32.png) [@chris](https://www.ruby-forum.com/u/chris)\
**Post date:** [January 30, 2006, 2:10am UTC](https://www.ruby-forum.com/t/printing-quality-documents-invoices-etc-from-rails/98549/4 "2006-01-30T02:10:18Z")

</div>

It is used in a java project that I’m on at work. I haven’t had too much  
contact with that  
part of the project, but the guy who’s doing it seems very pleased with  
Jasper reports. I  
think it might not be as powerful/easy-to-use/well-documented as the  
$$$$ report engines  
out there, but it’s hard to beat for the price.

I skimmed through this wiki page and have to say that the “execute a  
shell script”  
approach isn’t the best idea. As the author points out towards the  
bottom, you wind up  
starting the jvm every time… ugh. And the scripts are  
platform-dependent.

I’m pretty sure Jasper comes with servlets that you can drop into tomcat  
or jetty. You  
could have the servlet container running on it’s regular port of 8080  
but only accepting  
connections from localhost. Or, you could seemlessly blend the jasper  
reports stuff with  
the rails app by proxying the url pattern for reports  
([mydomain.com/reports](http://mydomain.com/reports)) to the  
servlet container in your web server config.

Or, just to be extremely buzzword compliant, you could do it as a web  
service! 😑

Now, this isn’t to say that any of this is trivial if you haven’t done  
it… but it’s  
always good to learn new things, right? You could take the script  
approach to get it  
working and then replace it with a daemon approach when you get it  
figured out.

b

PS: we trained the client to use the iReport  
([http://ireport.sourceforge.net/](http://ireport.sourceforge.net/)) gui tool  
for Jasper Reports and they’ve been very pleased (heh, started asking if  
they could  
_update_ their data with ireport!).
