Printing from Ruby

S

Seebs

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
 
S

Seebs

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,010
Latest member
MerrillEic

Latest Threads

Top