I make thousands of ruby-gnuplot stories and use a gem called shrimp to compile them into pdf. Below is a shrimp code snippet that includes some useful features:
require 'prawn' def create_pdf toy_catalogue = @toy_catalogue full_output_filename ||= "#{output_path}/#{pre-specified_filename_string}" Prawn::Document.generate(full_output_filename, :page_layout => :portrait, :margin => 5, :skip_page_creation => false, :page_size => [595, 1000]) do toy_catalogue.each do |toy| start_new_page image toy[:plan_view], :at => [0,900], :width => 580 image toy[:front_view], :at => [0, 500], :width => 585 font_size(20) { draw_text toy[:name], :at => [5, 920] } draw_text "production_date = #{toy[:date]}", :at => [420, 930] end end end
It should be easy enough to adapt to your goals.
sjmurphy
source share