# Printing from Ruby

**URL:** <https://www.ruby-forum.com/t/printing-from-ruby/179387>\
**Category:** Ruby\
**Created:** [November 24, 2009, 1:41am UTC](https://www.ruby-forum.com/t/printing-from-ruby/179387 "2009-11-24T01:41:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seebs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/439d5e/32.png) [@Seebs](https://www.ruby-forum.com/u/Seebs)\
**Post date:** [November 24, 2009, 1:41am UTC](https://www.ruby-forum.com/t/printing-from-ruby/179387/1 "2009-11-24T01:41:19Z")

</div>

Long story short: I wanted to make pretty-printed stuff. I have, after  
several hours, gotten something that can produce acceptable output by  
rendering as HTML, which I then run through Firefox – with five mostly  
undocumented about:config changes and an elaborate printing procedure.

That sucks.

I am looking for the ability to do things that are frankly not much  
beyond  
trivial HTML type layout – a little CSS, but nothing past font sizes  
and  
colors and the like. What are good choices for PDF or postscript  
rendering  
from Ruby, if any? It might be nice to have visibility into rendering  
at  
the level of “if I render this block of text, how tall does it come  
out?”

I don’t need any graphics past maybe the ability to draw solid-colored  
boxes  
behind text.

-s

---

<div class="post-metadata">

**Author:** ![Seebs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/439d5e/32.png) [@Seebs](https://www.ruby-forum.com/u/Seebs)\
**Post date:** [November 24, 2009, 1:48am UTC](https://www.ruby-forum.com/t/printing-from-ruby/179387/2 "2009-11-24T01:48:21Z")

</div>

Sounds like a job for prawn: [http://prawn.majesticseacreature.com/](http://prawn.majesticseacreature.com/)

We used it for something very similar, and it was superb.

dwh

---

<div class="post-metadata">

**Author:** ![Seebs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/439d5e/32.png) [@Seebs](https://www.ruby-forum.com/u/Seebs)\
**Post date:** [November 24, 2009, 1:53am UTC](https://www.ruby-forum.com/t/printing-from-ruby/179387/3 "2009-11-24T01:53:37Z")

</div>

Maybe prince?

Blog: [http://random8.zenunit.com/](http://random8.zenunit.com/)  
Twitter: [http://twitter.com/random8r](http://twitter.com/random8r)  
Learn: [http://sensei.zenunit.com/](http://sensei.zenunit.com/)  
New video up now at [http://sensei.zenunit.com/](http://sensei.zenunit.com/) real fastcgi rails  
deploy process! Check it out now!

---

<div class="post-metadata">

**Author:** ![Seebs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/439d5e/32.png) [@Seebs](https://www.ruby-forum.com/u/Seebs)\
**Post date:** [November 24, 2009, 2:45am UTC](https://www.ruby-forum.com/t/printing-from-ruby/179387/4 "2009-11-24T02:45:42Z")

</div>

On 2009-11-24, Denis H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Sounds like a job for prawn: [http://prawn.majesticseacreature.com/](http://prawn.majesticseacreature.com/)
> 
> We used it for something very similar, and it was superb.

Thanks! This conveniently aligns with what I’d concluded; looks like  
PDF::Writer isn’t updated for 1.9, and Prawn looks nice.

Although it worries me a bit that I get a ton of warnings running it  
under  
1.9. But they look harmless.

-s
