# Generating Images/PDF Server-Side

**URL:** <https://www.ruby-forum.com/t/generating-images-pdf-server-side/147387>\
**Category:** Rails\
**Created:** [September 1, 2008, 10:39am UTC](https://www.ruby-forum.com/t/generating-images-pdf-server-side/147387 "2008-09-01T10:39:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdaoust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@mdaoust](https://www.ruby-forum.com/u/mdaoust)\
**Post date:** [September 1, 2008, 10:39am UTC](https://www.ruby-forum.com/t/generating-images-pdf-server-side/147387/1 "2008-09-01T10:39:18Z")

</div>

Hi,

I am working on a project where I need to generate a chart (a bit like a  
pie chart, but very customised) and insert this into a PDF document.

Does anybody have any advice on ruby libraries (or other techniques) for  
doing this? Open to suggestions?

The resulting PDF will be designed for printing and so ideally should be  
vector throughout (or any raster images 300dpi). I was thinking of some  
kind of vector based drawing library to generate the chart and then  
insert this into a PDF using a PDF generator library (like Prawn).

All ideas very welcome!

Thanks,

~ Mark

---

<div class="post-metadata">

**Author:** ![mdaoust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@mdaoust](https://www.ruby-forum.com/u/mdaoust)\
**Post date:** [September 1, 2008, 10:42am UTC](https://www.ruby-forum.com/t/generating-images-pdf-server-side/147387/2 "2008-09-01T10:42:44Z")

</div>

You could try [http://ruby-pdf.rubyforge.org/pdf-writer/](http://ruby-pdf.rubyforge.org/pdf-writer/)

A good search for “ruby generate pdf” shows lots of useful results.

Marcelo.

On Mon, Sep 1, 2008 at 5:39 AM, Mark D. \<

---

<div class="post-metadata">

**Author:** ![mdaoust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@mdaoust](https://www.ruby-forum.com/u/mdaoust)\
**Post date:** [September 1, 2008, 10:43am UTC](https://www.ruby-forum.com/t/generating-images-pdf-server-side/147387/3 "2008-09-01T10:43:20Z")

</div>

google search, not good. Though a google search is also a good search 🙂

On Mon, Sep 1, 2008 at 5:41 AM, Marcelo de Moraes S.  
\<removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![mdaoust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@mdaoust](https://www.ruby-forum.com/u/mdaoust)\
**Post date:** [September 1, 2008, 10:44am UTC](https://www.ruby-forum.com/t/generating-images-pdf-server-side/147387/4 "2008-09-01T10:44:32Z")

</div>

Thanks, have had a look at that one already.

The thing I’m really interested in is some way to generate vector images  
with ruby?

---

<div class="post-metadata">

**Author:** ![mdaoust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@mdaoust](https://www.ruby-forum.com/u/mdaoust)\
**Post date:** [September 1, 2008, 11:03am UTC](https://www.ruby-forum.com/t/generating-images-pdf-server-side/147387/5 "2008-09-01T11:03:55Z")

</div>

Hello Mark,

I’m not sure, never had to draw vector images with ruby. One thing that  
comes to mind is Flash, even though you wouldn’t be using ruby to  
generate  
the vector images, but instead only passing data (json/xml) to flash  
which  
in turn would parse it and draw the vectors. There are many flash-based  
graphing libraries around.

If you really need to draw and output vector images server-side with  
ruby  
(maybe to try to insert it as an image in a pdf, as you told), I would  
suggest you to look into [http://nubyonrails.com/pages/gruff](http://nubyonrails.com/pages/gruff), a graphing  
library written by Geoffrey Grosenbach (aka topfunky), from peecode, try  
to  
figure out which imaging library he used to make the graphics’ vectors.

Good luck,

Marcelo.

On Mon, Sep 1, 2008 at 5:44 AM, Mark D. \<
