I came across a new Ruby library today named Origami that looks very useful for analyzing the structure of PDF documents. While it can produce PDFs, I doubt it's as capable or elegant as Prawn (the library we currently use in Asciidoctor PDF). Where Origami can help is to inspect PDF output, much like we use the DOM inspector in Chrome and Firefox.
The GUI relies on GTK2. Here's what I did to get it running:
cd origami-pdf
rvm use 2.1@origami-dev --create
gem install gtk2
rake gem
gem install pkg/origami-*.gem
pdfwalker sample.pdf