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).