Printing from Ruby

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

Sounds like a job for prawn: http://prawn.majesticseacreature.com/

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

dwh

Maybe prince?

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

On 2009-11-24, Denis H. [email protected] wrote:

Sounds like a job for prawn: 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