I'm not sure where I came across the thought, but at some point it occured to me that if Ruby is able to generate text files so easily, and Rails apparently generates HTML files via 'views', why wouldn't Ruby be able to generate other kinds of files? I looked around a bit and found that there are quite a few nifty gems for PDF generation with a Ruby script. Here's one I tried out: PDFKit.

I found it from reading "Rethinking PDF Creation in Ruby". It depends primarily on wkhtmltopdf, a gem that generates PDFs with Ruby from HTML/CSS files or URLs (which is super cool).

Wow. That was easier than I thought. This turned out to not be a big project after all, and I got to make something cool while getting some practice in using gems, too. I was excited to see how easy it was to generate PDFs by simply passing in my files. Click here to view the Google pdf page I generated by passing the program a URL instead of an HTML file.